Hi MFP Admin,
On-premises, sending email directly to recipient mail servers (using DNS MX lookups and port 25) is usually unrestricted. But once the server was moved into Azure, that behavior changed because Azure VMs can't send outbound traffic over port 25 by default, regardless of whether you're using a public MX record or a custom domain.
The ability to send outbound emails via port 25 depends on your subscription type:
- Enterprise Agreement (EA) and Microsoft Customer Agreement for Enterprise (MCA-E) Subscriptions: Outbound SMTP connections on port 25 are allowed by default. However, for Enterprise Dev/Test subscriptions, port 25 is blocked by default but can be unblocked upon request.
- Other Subscription Types (like Pay-As-You-Go): Outbound traffic on port 25 is blocked by default, and this restriction cannot be lifted
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 which is not blocked.
Using these email delivery services on authenticated SMTP port 587 isn't restricted in Azure, regardless of the subscription type. https://learn.microsoft.com/en-us/azure/virtual-network/troubleshoot-outbound-smtp-connectivity
similar references: https://learn.microsoft.com/en-us/answers/questions/1679480/virtual-machine-smtp-(25)-port-blocked-fix
Hope this helps!
Let me know if you have any further queries!
Hope the information provided is helpful to you, I would request you to kindly please consider accepting it as an answer and do a thumbs up at “Was it helpful”. This in turn will benefit other community members with similar scenario navigate better to right solution.