Send Email from your GMAIL account using ASP.Net


I have come across the many forum and found there so many developers asked how to send email but the don’t have SMTP server. So just try to guide here, they can test their email functionality with the help of gmail account.
I would like to suggest here those guy who want to implement their email functionality in his project then for testing purpose they can use Gmail account.

MailMessage MyMailMessage=new  MailMessage();
MyMailMessage.From = new MailAddress("g.parwez@gmail.com");
MyMailMessage.To.Add("g.parwez@gmail.com");
MyMailMessage.Subject = "Parwej Testing !!!";
MyMailMessage.Body = "This is the test text for Parwej Ahamad";
SmtpClient SMTPServer=new SmtpClient("smtp.gmail.com");
SMTPServer.Port = 587;
SMTPServer.Credentials =new System.Net.NetworkCredential("yourgmaid", "yourgmailpassword");
SMTPServer.EnableSsl = true;
SMTPServer.Send(MyMailMessage);
If you have any issues with this code then you can drop me a mail on ahamad.parwej@gmail.com
Advertisements
Tagged with: , , , , ,
Posted in .Net, Asp.Net, C#, email, gmail, vb.net
3 comments on “Send Email from your GMAIL account using ASP.Net
  1. Xcvekpjm says:

    zNCO8e comment2 ,

  2. Mzoweqgd says:

    UBk56E comment5 ,

  3. gameskillz says:

    Killzone 2 – the best PS3 game yet?Still LittleBigPlanet for me, but Sony’s new shooter is mightily impressive.
    What you think about my web? http://www.easyfaxlesspaydayloan.com/payday-loans-online.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Top Rated

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

Blog Stats
  • 29,596 hits
%d bloggers like this: