Click here to Skip to main content
13,042,630 members (73,164 online)
Rate this:
Please Sign up or sign in to vote.
Can we Send mail from Proxy Server using gmail.
if yes
then what should be the setting and code for this.
Plz Send me Information on [DELETED]"

[edit]Email address deleted - OriginalGriff[/edit]
Posted 13-Jul-12 21:01pm
Updated 13-Jul-12 21:05pm
OriginalGriff 14-Jul-12 3:05am
Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Yes you can send mail through gmail to the client if the SMTP server is not installed.

string emailid=emailtxt.Text;
 MailMessage mail = new MailMessage();
            mail.From = new MailAddress("");
            mail.Subject = "Email using Gmail";
            string Body = "Hi all" ;
            mail.Body = Body;
            mail.IsBodyHtml = true;
            SmtpClient smtp = new SmtpClient();
            smtp.Host = ""; 
            smtp.Credentials = new System.Net.NetworkCredential
                 ("", "yourpassword");
            smtp.EnableSsl = true;

yourpassword here is the gmail password.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Send mail from Proxy Server using gmail
Yes, you can send. GMail has exposed it's SMTP server name( and PORT(587) for it.
Imports System.Net.Mail
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
            Dim SmtpServer As New SmtpClient()
            Dim mail As New MailMessage()
            SmtpServer.Credentials = New Net.NetworkCredential("", "password")
            SmtpServer.Port = 587
            SmtpServer.Host = ""
            mail = New MailMessage()
            mail.From = New MailAddress("")
            mail.Subject = "Test Mail"
            mail.Body = "This is for testing SMTP mail from GMAIL"
            MsgBox("mail send")
        Catch ex As Exception
        End Try
    End Sub
End Class

Still, In case needed, have a look at these:
Video: VB.NET - Sending an E-mail using Gmail - YouTube[^]
How to Send Mails from your GMAIL Account through VB.NET or C#. Windows Programming, with a Bit of Customization[^]
Member 8561616 14-Jul-12 5:22am
Sir I have already written the Same Code but An Exception Comes "Failure Sending Mail"unable to connect to remote server.
Sandeep Mewara 14-Jul-12 6:36am
Make sure that there is no firewall issue.
Sandeep Mewara 14-Jul-12 6:38am
Also add this and see: SmtpServer.EnableSsl = True
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

No. The SMTPClient class doesn't support proxies.

There's really not even a specification for SMTP proxy support as far as I know. There are work arounds, but companies rarely ever let you get away with using them.

You would normally have a SMTP server INSIDE your proxy that can forward mail to outside mail servers.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 14 Jul 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100