protected void button_Click(object sender, EventArgs e)
{
MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("smtp.bizmail.yahoo.com");
mail.From = new MailAddress("joju@yyy.com");
mail.To.Add("arun@yyy.com");
mail.Subject = "Test Mail";
mail.Body = "This is for testing SMTP mail from GMAIL";
SmtpServer.Port = 465;
SmtpServer.Credentials = new System.Net.NetworkCredential(ConfigurationManager.AppSettings["EmailFromAddress"], ConfigurationManager.AppSettings["EmailPassword"]);
SmtpServer.EnableSsl = false;
SmtpServer.Send(mail);
}
}
when i try to run this code i get an error-"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
plz hlp ...
Go to the complete details ...