When I try to send STMP email in ASP.NET using SSL on my new GoDaddy email address, it does not work. I receive an error message saying Unable to read data from the transport connection: net_io_connectionclosed.
Here are the email settings for the server:
Here's the snippet from my web.config with the email server information:
<system.net>
<mailSettings>
<smtp from="no-reply@mysite.com" >
<network host="smtpout.secureserver.net" port="465" userName="no-reply@mysite.com" password="password123" enableSsl="true" />
</smtp>
</mailSettings>
</system.net>
And here's the C# code that sends the email.
MailMessage message = new MailMessage();
message.To.Add(new MailAddress(to));
message.Subject = "Message from " + inputModel.Name;
message.Body = body;
message.IsBodyHtml = true;
using (var smtp = new SmtpClient())
{
smtp.Send(message);
}
Ports 80, 3535, and 25 work fine without SSL, but none of the four work with SSL. I even tried port 587 with SSL, and after quite a long time it just times out.
How can I get these emails to send using SSL?