Thank you for reaching out to the Microsoft Q&A platform.
By default, outbound SMTP traffic on TCP port 25 is blocked by the Azure platform. However, outbound traffic on port 587 is not blocked by default.
Make sure you have an enough space VM configuration as per your requirement.
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. These services are used in part to maintain IP reputation which is critical for delivery reliability. Azure Communication Services offers an authenticated SMTP relay service.
Using these email delivery services on authenticated SMTP port 587 isn't restricted in Azure, regardless of the subscription type.
For more details, please refer to the below documentation:
Troubleshoot outbound SMTP connectivity problems in Azure.
If it was helpful, please click "Upvote" on this post to let us know.
Thank You.