In my web application I am sending mail using using System.Net.Mail

Ajay Singh Moltra 135 Reputation points
2024-07-22T09:36:39.85+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

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,435 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,764 questions
0 comments No comments
{count} votes

Accepted answer
  1. Q&A Assist
    2024-07-22T09:36:39.8566667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    It's possible that the issue with sending email in your web application hosted on Azure is due to the SMTP server name or port number being incorrect. When publishing your site to a hosting provider, the SMTP server name might change to localhost, which means you may need to change the SMTP server name as part of your publishing process. Additionally, some providers require the use of port 587 or another port instead of port 25. Double-check with the owner of the SMTP server what port number they expect you to use.

    It's also worth noting that Microsoft recommends using authenticated SMTP relay services to send email from Azure VMs or from Azure App Service. These services are used to maintain IP and domain reputation to minimize the possibility that external domains reject your messages or put them in the SPAM folder.


    References:

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful