title: GMail SMTP via C# .Net errors on all ports
body: <p>I've been trying for a whlie on this, and have so far been failing miserably.  My most recent attempt was lifted from this stack code here:  <a href="https://stackoverflow.com/questions/704636/sending-email-through-gmail-smtp-server-with-c">Sending email through Gmail SMTP server with C#</a>, but  I've tried all the syntax I could find here on stack and elsewhere.  My code currently is:</p>
  
  <pre><code>var client = new SmtpClient("smtp.gmail.com", 587)
  {
      Credentials = new NetworkCredential("me@gmail.com", "mypass"),
      EnableSsl = true
  };
  
  client.Send("me@gmail.com","me@gmail.com","Test", "test message");
  </code></pre>
  
  <p>Running that code gives me an immediate exception "Failure sending mail" that has an innerexeption "unable to connect to the remote server".</p>
  
  <p>If I change the port to 465 (as gmail docs suggest), I get a timeout every time.</p>
  
  <p>I've read that 465 isn't a good port to use, so I'm wondering what the deal is w/ 587 giving me failure to connect.  My user and pass are right.  I've read that I have to have POP service setup on my gmail account, so I did that. No avail.</p>
  
  <p>I was originally trying to get this working for my branded GMail account, but after running into the same problems w/ that I <em>thought</em> going w/ my regular gmail account would be easier... so far that's not the case.</p>