Author: cazacuvlad | Posted on: 12/4/2008 10:13:31 AM | Views : 433

I included a contact form with system.net.mail in a website which won't work. It doesn't give an exact error, it only says "Failure to send mail".
This is the code:

 
protected void butSend_Click(object sender, System.EventArgs e)
{
try
{
System.Net.Mail.MailMessage msgMail = new System.Net.Mail.MailMessage();

msgMail.From = new System.Net.Mail.MailAddress(txtFrom.Text);
msgMail.To.Add(new System.Net.Mail.MailAddress("address@domain.com"));
msgMail.Subject = txtSubject.Text;
msgMail.Body = txtMessage.Text;
msgMail.Priority = System.Net.Mail.MailPriority.Normal;
msgMail.IsBodyHtml ...

Go to the complete details ...