question

bharathn-msft avatar image
0 Votes"
bharathn-msft asked ·

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

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-webapps
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Grmacjon-MSFT avatar image
0 Votes"
Grmacjon-MSFT answered ·

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



· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.