title: System.Net.Mail.SmtpException: 'The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Auth
body: <pre><code> //less security is enabled
  smtp.Host = &quot;smtp.gmail.com&quot;;
  smtp.EnableSsl = true;
  NetworkCredential NetworkCred = new NetworkCredential(&quot;pk.uzikhan@gmail.com&quot;, &quot;*********&quot;);
  smtp.UseDefaultCredentials = true;
  smtp.Credentials = NetworkCred;
  smtp.Port = 587;
  smtp.Send(mm);
  //       ViewBag.Message = &quot;Email sent.&quot;;
  return Ok(&quot;email sent&quot;);
  </code></pre>