Hi all,
I am using the code below to send a mail in my application but there is an error while sending mail is as described below.
System.Net.Mail.MailMessage m = new System.Net.Mail.MailMessage("sathis@gmail.com", "sathis@gmail.com");
m.Subject = "Test mail";
m.Body = "Testing Mail From Gmail.com";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(); // server name and port number
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("sathis@gmail.com", "******");
try
{
smtp.Send(m);
}
catch (Exception ex) { Response.Write(ex.Message); }
Error
~~~~
System.Net.Mail. ...
Go to the complete details ...