title: SmtpException: Unable to read data from the transport connection: net_io_connectionclosed
body: <p>I am using the <code>SmtpClient</code> library to send emails using the following:</p>
  
  <pre><code>SmtpClient client = new SmtpClient();
  client.Host = "hostname";
  client.Port = 465;
  client.DeliveryMethod = SmtpDeliveryMethod.Network;
  client.UseDefaultCredentials = false;
  client.EnableSsl = true;
  client.Credentials = new NetworkCredential("User", "Pass);
  client.Send("from@hostname", "to@hostname", "Subject", "Body");
  </code></pre>
  
  <p>The code works fine in my test environment, but when I use production SMTP servers, the code fails with an <code>SmtpException</code> "Failure sending mail." with an inner <code>IOException</code> "Unable to read data from the transport connection: net_io_connectionclosed".</p>
  
  <p>I've confirmed that firewalls are not an issue. The port opens just fine between the client and the server. I'm not sure what else could throw this error.</p>