Share via

How to fix Outbound SMTP issue from Azure VM

baburao sirapurapu 0 Reputation points
2026-04-01T01:57:45.5566667+00:00

How to fix Outbound SMTP issue from Azure VM, postfix server not able to send emails
Getting Connection timed out

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Manish Deshpande 5,255 Reputation points Microsoft External Staff Moderator
    2026-04-08T09:47:06.5+00:00

    Hello Baburao Sirapurapu

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    Azure does not allow outbound SMTP traffic on port 25 from most Azure services, and this restriction applies across many subscription types to protect the global IP reputation of Azure resources.

    The recommended way to send email from Azure VMs or Azure App Service is to use an authenticated SMTP relay service, which operates on TCP port 587.

    https://dotnet.territoriali.olinfo.it/en-us/troubleshoot/azure/virtual-network/troubleshoot-outbound-smtp-connectivity#recommended-method-of-sending-emailUser's image

    Azure Communication Services – provides an authenticated SMTP relay endpoint

    These services help preserve IP reputation, which is essential for reliable email delivery. Azure Communication Services provides an authenticated SMTP relay that you can use, and if you need higher throughput, you can request increased limits through a support case. Sending email over authenticated SMTP on port 587 is fully supported and not restricted in Azure for any subscription type.

    Reference:
    https://dotnet.territoriali.olinfo.it/en-us/azure/communication-services/overview

    https://dotnet.territoriali.olinfo.it/en-us/azure/communication-services/quickstarts/email/send-email-smtp/smtp-authentication?tabs=built-in-role

    Kindly let us know if the above helps or you need further assistance on this issue.

    Thanks,
    Manish.

    0 comments No comments

  2. Marcin Policht 85,250 Reputation points MVP Volunteer Moderator
    2026-04-01T03:18:28.1433333+00:00

    Refer to https://dotnet.territoriali.olinfo.it/en-us/troubleshoot/azure/virtual-network/troubleshoot-outbound-smtp-connectivity

    Recommended method of sending email

    We recommend you use authenticated SMTP relay services to send email from Azure VMs or from Azure App Service. Connections to authenticated SMTP relay services are typically on TCP port 587 and isn't blocked. These services are used in part to maintain IP reputation that is critical for delivery reliability. Azure Communication Services offers an authenticated SMTP relay service. Ensure that the default rate limits are appropriate for your application and open a support case to raise them if needed.

    Using these email delivery services on authenticated SMTP port 587 isn't restricted in Azure, regardless of the subscription type.

    Enterprise and MCA-E

    For VMs and Azure Firewall that are deployed in standard Enterprise Agreement or Microsoft Customer Agreement for enterprise (MCA-E) subscriptions, the outbound SMTP connections on TCP port 25 aren't blocked. However, there's no guarantee that external domains accept the incoming emails from the VMs and Azure Firewall. For emails rejected or filtered by the external domains, contact the email service providers of the external domains to resolve the problems. These problems aren't covered by Azure support.

    For Enterprise Dev/Test subscriptions, port 25 is blocked by default. It's possible to have this block removed. To request to have the block removed, go to the Cannot send email (SMTP-Port 25) section of the Diagnose and Solve section in the Azure Virtual Network resource in the Azure portal and run the diagnostic. This process exempts the qualified enterprise dev/test subscriptions automatically.

    After the subscription is exempted from this block, the VMs must be stopped, deallocated, and then restarted to get the new network policy, all VMs in that subscription are exempted going forward. If the virtual network owned by the exempted subscription has a delegated subnet (to an App Service Environment for example), you must add and remove a new temporary subnet in the Virtual Network. The exemption applies only to the subscription requested and only to VM traffic that is routed directly to the internet.

    All other subscription types

    The Azure platform blocks outbound SMTP connections on TCP port 25 for deployed VMs. This block is to ensure better security for Microsoft partners and customers, protect Microsoft's Azure platform, and conform to industry standards.

    If you're using a subscription type that isn't an Enterprise Agreement or MCA-E, we encourage you to use an authenticated SMTP relay service, as outlined earlier in this article.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    0 comments No comments

Your answer

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