send email using from gmail account

Hello Frd's

Below Code are For Sending Email From your gamil account to any other Account.It's Working Code you can directly run that Code Without Changing Any Value.

Or Change From , to , NetworkCredential

Code :-

MailMessage msg = new MailMessage();
msg.From = new MailAddress("");
msg.Subject = "test";
msg.Body = "body";
msg.IsBodyHtml = true;
msg.Priority = MailPriority.High;
System.Net.NetworkCredential authorise = new
System.Net.NetworkCredential("", "ketantesttest");
SmtpClient spclient = new SmtpClient("", 587);
spclient.EnableSsl = true;
spclient.UseDefaultCredentials = false;
spclient.Credentials = authorise;

Posted in |


  1. Sangam Uprety Says:

    Very good article. I have been enjoying this feature of "sending email using gmail (sounds like a song!)" for long time. Thanks.

Post a Comment