title: C# - Can't send mail in WIndows Azure via Gmail SMTP
body: <p>This is my Web.config:</p>
  
  <pre><code>&lt;system.net&gt;
      &lt;mailSettings&gt;
          &lt;smtp deliveryMethod="Network"&gt;
              &lt;network defaultCredentials="true" enableSsl="true" host="smtp.gmail.com" port="25" userName="xxxxxxx@gmail.com" password="xxxxxxxxxxx"/&gt;
          &lt;/smtp&gt;
      &lt;/mailSettings&gt;
  &lt;/system.net&gt;
  </code></pre>
  
  <p>My method:</p>
  
  <pre><code>public static void EmailVerification(string email, string nickname)
      {
          MailAddress from = new MailAddress("xxxxxxxxxxx", "xxxxxxxxxxxx");
          MailAddress to = new MailAddress(email);
  
          MailMessage message = new MailMessage(from, to);
  
          message.Subject = "Test";
          message.Body = "Test";
          SmtpClient client = new SmtpClient();
  
          try
          {
              client.Send(message);
          }
          catch(SmtpFailedRecipientException ex)
          {
              HttpContext.Current.Response.Write(ex.Message);
              return;
          }
      }
  </code></pre>
  
  <p>My failure SmtpException:</p>
  
  <pre><code>Failure sending mail.
  </code></pre>
  
  <p>InnerException:</p>
  
  <pre><code>Unable to connect to the remote server
  </code></pre>
  
  <p>I'm testing it locally but I guess it should work. I have to run it on Windows Azure, I tried and it didn't work too. Is there something I'm missing?</p>