title: Mail code works in localhost but not on the URL website afterwards
body: <p>I made a web application on visual studio 2017 for ASP.NET core. It has a contact option where users send me an email. It works perfectly in localhost as I receive the feedback. When I build/release using Azure DevOps onto azure app services in the portal my website at its URL loses the functionality of the email option. I wrote the email code using MailKit, if you guys have a better option that works let me know! Thank you.  </p>
  
  <pre><code>        var message = new MimeMessage();
          message.From.Add(new MailboxAddress(inputEmail));
          message.To.Add(new MailboxAddress("myemail"));
          message.Subject = "Message from: " + inputName;
          message.Body = new TextPart("plain")
          {
              Text = inputMessage
          };
          using (var client = new SmtpClient())
          {
              client.Connect("smtp.gmail.com", 587, false);
              client.Authenticate("email", "password");
              client.Send(message);
              client.Disconnect(true);
          };
          return RedirectToAction("Index");
  </code></pre>
  
  <p>mywebsite.azurewebsites.net is currently unable to handle this request.</p>