Emails have stopped working from azure web app

Suvarna 0 Reputation points
2023-12-18T10:55:31.3366667+00:00

We have hosted our website on the Microsoft Azure platform. We able to send emails since last week, but from yesterday the mails are not reaching the mail server. We have tested it from our local and it is working. However, from the azure site, it is not working getting error like "unable to connect to remote server"

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

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2023-12-19T06:05:26.54+00:00

    @Suvarna Thanks for reaching here!

    You might want to know that to send email from the web application, you need to use a relay service. This is a requirement for all Azure services, including VMs and cloud services. Azure does not allow direct email sending to prevent SPAM abuse. You can use SendGrid, O365, other third-party relay services, or your own on-premises relay service. Please check if you are using a relay service for your email. If not, you must configure your application to use one. see- https://learn.microsoft.com/en-us/azure/virtual-network/troubleshoot-outbound-smtp-connectivity

    If already using- try below steps to troubleshoot-

    1. Check if the SMTP server is up and running, try to connect to it using a telnet client. If the connection fails, the SMTP server may be down or there may be a network problem.
    2. See if the SMTP server settings in your web app are correct, verify that the SMTP server address, port number, and credentials match the ones provided by your SMTP service.
    3. If there are any firewall rules or network security groups that block outbound traffic from your web app to the SMTP server, look at the network security group rules for your web app and make sure they allow the SMTP port.
    4. If you are using a third-party SMTP service, make sure that you have configured it correctly and that your web app has permission to use it.

    Suggest you to refer this detailed blog on How to fix SMTP problems and send emails from Azure web apps

    Let us know, if issue remains.


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.