title: Sending email using ASP.NET I am getting this error
body: <blockquote>
    <p>The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. u6sm344516ibd.6</p>
  </blockquote>
  
  <p>I have my code like this?</p>
  
  <pre><code>MailAddress to = new MailAddress("xxxxx@gmail.com");
  MailAddress from = new MailAddress("xxx@gmail.com");
  MailMessage message = new MailMessage(from, to);
  message.Subject = "Error Occred in the application:";
  message.Body = ex.Message;
  SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
  </code></pre>