Trending on MSDN: Unable to send mail through Azure hosting environment RRS feed

bharathn-msft 5,101 Reputation points Microsoft Employee
2019-10-29T21:40:18.853+00:00

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.

Sourced from MSDN

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,092 questions
0 comments No comments
{count} votes

Accepted answer
  1. Grmacjon-MSFT 18,646 Reputation points
    2019-10-29T22:50:04.99+00:00

    Welcome to the Microsoft Q&A (Preview) platform. Happy to answer your question.

    The only way to use email functionality as of now on Azure Web App is via an SMTP relay. SendGrid is the best way to go if you're trying to set up mail with Azure App Services. If you are not using a relay service to send email, you are in an unsupported scenario within all of Azure (including running an application in a VM or cloud service).

    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. Relay services include SendGrid, O365, other third-party relay services, and your own on-premises relay services. Please read this blog for more information. You can follow the step by step guide provided in this documentation to learn How to Send Email Using SendGrid with Azure. Let us know if you have additional questions.

    Sourced from MSDN

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.