This is the code I use to send my form via email:
protected void sendMail(string strFrom, string strBody)
{
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress(strFrom);
mail.To.Add("myEmail@myDomain.com");
//set the content
mail.Subject = txtSubject.Text;
mail.Body = strBody;
mail.IsBodyHtml = false;
//send the message
SmtpClient smtp = new SmtpClient("noAuth.myDomain.com");
smtp.Send(mail);
}
And this is the error message I received:
Server Error in '/home' Application.
--------------------------------------------------------------------------------
Unable to read data from the transport connection: net_io_connectionclosed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed.
Source Error:
Line 84: //send the message
Line 85: SmtpClient smtp = new SmtpClient("noAuth.myDomain.com");
Line 86: smtp.Send(mail);
Line 87: }
Line 88: }
Source File: e:\ Line: 86
protected void sendMail(string strFrom, string strBody)
{
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress(strFrom);
mail.To.Add("myEmail@myDomain.com");
//set the content
mail.Subject = txtSubject.Text;
mail.Body = strBody;
mail.IsBodyHtml = false;
//send the message
SmtpClient smtp = new SmtpClient("noAuth.myDomain.com");
smtp.Send(mail);
}
And this is the error message I received:
Server Error in '/home' Application.
--------------------------------------------------------------------------------
Unable to read data from the transport connection: net_io_connectionclosed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed.
Source Error:
Line 84: //send the message
Line 85: SmtpClient smtp = new SmtpClient("noAuth.myDomain.com");
Line 86: smtp.Send(mail);
Line 87: }
Line 88: }
Source File: e:\ Line: 86