Hi i am developing an application that sends e-mails without opening an internet explorer and i tried the following code:
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add("[email protected]");
message.Subject = "Ava Kirolos";
message.From = new System.Net.Mail.MailAddress("[email protected]");
message.Body = "If God is for us";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("localhost");
try
{
smtp.Send(message);
}
catch (Exception caught)
{
MessageBox.Show("error");
}
but it throws an exception : Failure sending mail
can any body plz help me with that issue?????
Sending e-mail problem
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Ryan AlfordRank #1,411 · 1.2K reputationPosted Dec 29, 2008, 8:12 AM EST
Morcos Adel115 reputationPosted Dec 29, 2008, 8:35 AM EST