I have done a program to send email using yahoo smtp but it is showing an exception "failed to send mail"
following is the code
friends pls help
try
{
MailMessage objMsg = new MailMessage();
objMsg.To.Add(new MailAddress("address"));
objMsg.From = new MailAddress("address");
objMsg.Subject = "subject";
objMsg.Body = "test mail";
SmtpClient sc = new SmtpClient();
sc.Host = "smtp.mail.yahoo.com";
sc.Port = 465;
sc.Credentials = new NetworkCredential("address", "password");
sc.EnableSsl = false;
sc.DeliveryMethod = SmtpDeliveryMethod.Network;
sc.Send(objMsg);
MessageBox.Show("mail send");
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message);
}
Error in sending mail
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Kirtan PatelRank #292 · 8.6K reputationPosted Aug 8, 2009, 12:14 AM EDT
use Gmail to Send mail
its working Fine :)
Happy Coding :)
Rahul M7 reputationPosted Aug 8, 2009, 6:41 AM EDT
it worked