locked
Unable to send mail through Azure hosting environment RRS feed

  • Question

  • Hi All,

    In my web application I am sending mail using using System.Net.Mail; (c#).

    In my local machine mailing is working fine, but I hosted it on Azure the mail doesn't work.

    Please suggest

    Friday, March 1, 2019 11:33 AM

All replies

  • Hi dgauravk,

    Are we using Azure App Services and trying to set up the mail?

    If yes, you will need to use SendGrid with Azure App Services. Please follow this document as it talks about each step in detail on how to send email using SendGrid.

    Monday, March 4, 2019 4:29 AM
  • Hello Dgauravk,

    I agree with Dashleen, SendGrid is the best way to go if you're trying to set up mail with Azure App Services. The only way to use email functionality as of now on Azure Web App is via an SMTP relay. Microsoft recommends that Azure customers employ authenticated SMTP relay services (typically connected via TCP port 587 or 443, but often support other ports too) to send e-mail from Azure VMs or from Azure App Services.   This is because Azure is committed to stopping SPAM and preventing malicious users from using Azure IP addresses for abuse and adversely affecting the reputation of all Azure IPs. The use of these e-mail delivery services is in no way restricted in Azure regardless of subscription type.

    Hope that helps.

    Monday, March 4, 2019 7:17 PM