title: SmtpClient not working on google cloud server
body: <p>I have an SmtpClient that works fine when I run it localhost. However, on google cloud server it returns:</p>
  
  <pre><code>System.Net.Mail.SmtpException: Failure sending mail. ---&gt; System.Net.WebException: Unable to connect to the remote server ---&gt; System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond xx.xx.xx.xx:587
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>MailMessage mailMessage = new MailMessage();
  mailMessage.To.Add("User email");
  mailMessage.From = new MailAddress("My Company Email");
  mailMessage.Subject = "Test";
  mailMessage.Body = "MSG Test";
  
  SmtpClient smtp = new SmtpClient();
  smtp.Host = "smtp.mycompany.com"; //Or Your SMTP Server Address
  smtp.Port = 587;
  smtp.UseDefaultCredentials = false;
  smtp.Credentials = new System.Net.NetworkCredential
  ("email@mycompany.com", "password");
  smtp.Send(mailMessage);
  </code></pre>
  
  <p>Does anyone know why? Should I use Azure instead of google cloud for .net applications?</p>
  
  <p>Thanks</p>