title: Unable to read data from the transport connection?
body: <p>This is my first post on Stack, and I've <em>literally</em> just started programming, so please, be patient. </p>
  
  <p>I'm attempting to send an email to "x" email address when Button 1 is pressed. I've looked around, and every thread is jargon-heavy and not in my context. Please pardon me if this is a "newb' question, or if it's already thouroughly answered somewhere else.</p>
  
  <p>The error I'm getting is " 
  Failure sending mail. ---> System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed."</p>
  
  <p>Here's my code</p>
  
  <pre><code> using (SmtpClient smtp = new SmtpClient())
          {
              smtp.Host = "smtp.gmail.com";
              smtp.Port = 465;
              smtp.Credentials = new NetworkCredential("myemail", "mypassword");
              string to = "toemail";
              string from = "myemail";
              MailMessage mail = new MailMessage(from, to);
              mail.Subject = "test test 123";
              mail.Body = "test test 123";
              try
              {
                  smtp.Send(mail);
              }
              catch (Exception ex)
              {
                  Console.WriteLine("Exception caught in CreateTestMessage2(): {0}",
                              ex.ToString());
              }
  </code></pre>
  
  <p>Any help is greatly appreciated!</p>