"The operation has timed out" when trying to send email
- by user1718859
protected void Button1_Click(object sender, EventArgs e)
{
try
{
SmtpClient sm = new SmtpClient();
MailMessage ms = new MailMessage();
ms.To.Add(new MailAddress(TextBox1 .Text ));
ms.Subject = TextBox2.Text;
ms.Body = TextBox3.Text;
ms.IsBodyHtml = true;
sm.Send(ms);
}
catch (Exception el)
{
Response.Write(el.Message);
}
}