allow outbound port 25

Tan See Youu 陈诗右 0 Reputation points
2025-03-24T09:51:33.13+00:00

Dear support, this is my second time posting related to this issue. Can anyone help me to unblock outbound SMTP port 25? I'm currently using Azure sponsorship subscription.

I've tried all ways i can do, included the self diagnose feature on Azure portal. I showed completed with no issue found, but my program running on Azure VM still not able to trigger send email via port 25.

Thank you

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,051 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Amira Bedhiafi 34,336 Reputation points Volunteer Moderator
    2025-03-24T12:18:57.09+00:00

    Hi Tan See Youu 陈诗右 !

    Thank you for posting on Microsoft Learn.

    You're running into a known Azure policy: Outbound port 25 (SMTP) is blocked by default on most Azure subscription types, including:

    • Sponsorship
    • Free Trial
    • Pay-As-You-Go
    • Azure for Students

    This is intentional to prevent spam and abuse. Unfortunately, Azure will not unblock port 25 for these types of subscriptions, even upon request.

    Instead of sending mail directly on port 25, configure your application to use an SMTP relay service that supports authentication on other ports:

    • Microsoft 365 (Outlook): smtp.office365.com (port 587)
    • SendGrid (has a free Azure plan): smtp.sendgrid.net (port 587)
    • Mailgun, SMTP2GO, Amazon SES, etc.

    These services require authentication and typically support port 587 (TLS) or 465 (SSL).

    Example: SendGrid with Azure

    1. Sign up for SendGrid via Azure Marketplace
    2. Configure SMTP with:
         Host: smtp.sendgrid.net
         Username: apikey
         Password: <your-api-key>
      

    Azure only considers port 25 unblocking requests for Enterprise or MSDN (Visual Studio) subscriptions, and only in specific cases with strong justification. This is not available for Azure Sponsorship.


  2. Alex Burlachenko 10,800 Reputation points
    2025-03-24T12:39:05.7133333+00:00

    Dear Tan See Youu,

    Azure sponsorship subscriptions typically restrict port 25 by default. So for taht u can submit a support ticket via the Azure Portal. (\\i'm not recommend use port 25 just only if u really need port 25, but better use 587). If so select Issue Type like technical, Service: Virtual Machines, Problem Type: Networking, Subtype: "Cannot send email (SMTP/Port 25)". Be ready explain your legitimate use case (e.g., transactional emails, no spam). Declare compliance with Azure’s Anti-Spam Policy.

    In realty approval is very rare for sponsorship subscriptions. If denied, proceed to alternatives below. I would recommend that way. U can use Authenticated SMTP (Port 587)

    Configuration -> ini

    SMTP Server: smtp.office365.com (or your provider)  
    Port: 587  
    Encryption: TLS/SSL  
    Authentication: Enabled (username/password)  
    

    Bypasses port 25 restrictions.

    As well you can use Azure SMTP Relay Services

    SendGrid (Free tier available): Azure Integration Guide.

    Office 365 SMTP: Requires licensed mailbox.

    For verificationdo next - Test Connectivity (PowerShell):

    Test-NetConnection -ComputerName smtp.yourprovider.com -Port 587  
    
    1. Check NSG Rules:
      • Ensure no outbound rules block port 587.
    2. Review Subscription Limits:
      • Sponsorship subscriptions may throttle email traffic.

    As I said port 25 unblocking is highly restricted. Consider upgrading to a Pay-As-You-Go subscription if SMTP is critical. Prefer authenticated SMTP (port 587) to avoid being flagged for

    Best regards,

    Alex

    P.S. If my answer help to you, please Accept my answer

    0 comments No comments

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.