title: SmtpClient email sending has timeout
body: <p>I'm in face of a problem that drives me crazy!!!
  I have a small Delphi 7 application (using Indy 9 suite of components) used to send emails and all works fine.
  I'm trying to develop a C# app (Visual Studio 2012) that do the same, but in all my tests (with a lot of variations found in the internet) results always "The operation has timeout".
  I tested the same code in a VS2005 C# app a few years ago and it's worked, but now, the error occurs in VS2010 (my home) and VS2012 (work)</p>
  
  <p>Ps: The configuration of the SMTP server is OK, because the Delphi app is working!</p>
  
  <p>Ps2: I have tested this code in different machines to avoid antivirus/proxies issues and i my home and the result is the same, always..</p>
  
  <p>Below the C# code snippet:</p>
  
  <pre><code>private void button7_Click(object sender, EventArgs e)
  {
    using (var msg = new MailMessage("fromMail@myServer.com.br", "toMail@myServer.com.br", "Teste de Envio de E-mail em C#", "Mensagem enviada utilizando app em C#"))
    {
      using(var smtpClient = new SmtpClient("smtp.myServer.com.br", 465))
      {
        smtpClient.EnableSsl = true;
        smtpClient.Timeout = 2 * 60 * 1000;
        smtpClient.UseDefaultCredentials = false;
        smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
        smtpClient.Credentials = new NetworkCredential(msg.From.User, "mypassword");
        try
        {
          smtpClient.Send(msg);
        }
        catch (SmtpException ex)
        {
          MessageBox.Show("Erro ao enviar e-mail: " + ex.Message + "(" + ex.StatusCode + ")");
        }
      }
    }
  }
  </code></pre>
  
  <p>Edited: The server firewall was blocking my tests. View comments.</p>