I am trying to send email using Asp.net using my account....
I want to send it on a gmail account say "abc@gmail.com"
but it gives ERROR..
ErrorServer does not support secure connections.
the code is below:
try
{
//Create Mail Message Object with content that you want to send with mail.
System.Net.Mail.MailMessage MyMailMessage = new System.Net.Mail.MailMessage("abc@yahoo.co.in","xyz@gmail.com",
"This is the mail subject", "Just wanted to say Hello ");
MyMailMessage.IsBodyHtml = false;
System.Net.NetworkCredential mailAuthentication = new
System.Net.NetworkCredential("abc@yahoo.co.in", "123");
System.Net.Mail.SmtpClient mailClient = new System.Net.Mail.SmtpClient("smtp.mail.yahoo.com", 587);
//Enable SSL
mailClient.EnableSsl = true;
mailClient.UseDefaultCredentials = false;
mailClient.Credentials = mailAuthentication;
mailClient.Send(MyMailMessage);
this.TextBox1.Text = "SUccess";
}
catch(Exception ex)
{
this.TextBox1.Text = "Error" + ex.Message ;
}
Any ideas ???