December 14, 2024
011320_2302_HowtoSendEm3.png
When you try to send email out from exchange server VM at Azure, you will notice it will failed send email out. Because starting on November 15, 2017, outbound email messages that are sent directly to external domains (such as outlook.com and gmail.com) from a virtual machine (VM) are made available only to certain subscription types in Microsoft Azure. Outbound SMTP connections that use TCP port 25 were blocked. (Port 25 is primarily used for unauthenticated email delivery.), so you will notice the exchange server VM won't send email out after you configure send connector.

When you try to send email out from exchange server VM at Azure, you will notice it will failed send email out. Because starting on November 15, 2017, outbound email messages that are sent directly to external domains (such as outlook.com and gmail.com) from a virtual machine (VM) are made available only to certain subscription types in Microsoft Azure. Outbound SMTP connections that use TCP port 25 were blocked. (Port 25 is primarily used for unauthenticated email delivery.), so you will notice the exchange server VM won’t send email out after you configure send connector.

Today, I am going to show you how to configure exchange server for sending email with Azure, this exchange server is a VM of Nested Hyper-V host at Azure, if you don’t know how to build a Nested Hyper-V host in Azure, you can reference our Building Real Word lab in Azure Volume 1 book from https://leanpub.com/buildingrealworldlabsinazurevolume1) , this is step by step to tell you how to build your own lab in Azure.

One of solutions is using SMTP relay service to send email from VM in Azure, there is a good news for Azure customers, Azure customers can unlock 25,000 free emails each month. Today, I am going to show you how to use SendGrid as SMTP relay to help you send email out successful. If you don’t know how to create a free SendGrid account, please check my previously blog.

  1. Login to exchange server VM.
  2. Open Exchange admin center.

    011320 2302 HowtoSendEm1 - How to Send Email from Exchange Server VM with Azure

  3. On the Exchange admin center page, select mail flow.

    011320 2302 HowtoSendEm2 - How to Send Email from Exchange Server VM with Azure

  4. On the mail flow page, select connectors and then click +.

    011320 2302 HowtoSendEm3 - How to Send Email from Exchange Server VM with Azure

  5. On the new send connector page, type send connector name and select Internet Type, click Next.

    011320 2302 HowtoSendEm4 - How to Send Email from Exchange Server VM with Azure

  6. On the Network settings page, select Route mail through smart hosts and click +.

    011320 2302 HowtoSendEm5 - How to Send Email from Exchange Server VM with Azure

  7. On the Add smart host page, enter smtp.sendgrid.net and click Save.

    011320 2302 HowtoSendEm6 - How to Send Email from Exchange Server VM with Azure

  8. On the new send connector page, click Next.

    011320 2302 HowtoSendEm7 - How to Send Email from Exchange Server VM with Azure

  9. On the Smart host authentication page, select Basic authentication and select Offer basic authentication only after staring TLS, and enter SendGrid user name and Password. Click Next.

    011320 2302 HowtoSendEm8 - How to Send Email from Exchange Server VM with Azure

  10. On the Address space page, click +.

    011320 2302 HowtoSendEm9 - How to Send Email from Exchange Server VM with Azure

  11. On the add domain page, enter * as Full Qualified Domain Name (FQDN), click Save.

    011320 2302 HowtoSendEm10 - How to Send Email from Exchange Server VM with Azure

  12. On the new send connector page, select Scoped send connector, click Next.

    011320 2302 HowtoSendEm11 - How to Send Email from Exchange Server VM with Azure

  13. On the Source server page, click +.

    011320 2302 HowtoSendEm12 - How to Send Email from Exchange Server VM with Azure

  14. Select the exchange server and click add and then click OK.

    011320 2302 HowtoSendEm13 - How to Send Email from Exchange Server VM with Azure

  15. On the new send connector page, click Finish.

    011320 2302 HowtoSendEm14 - How to Send Email from Exchange Server VM with Azure

  16. Open Exchange Management Shell, use follow cmdlet to change the SendGrid send connector port from 25 to 2525.
    
    
    Set-SendConnector -Identity "SendGrid" -port 2525
    
    
    

You will notice send email out without issues now.

Ps. Don’t forget add your external IP address to whitelisted at SendGrid IP Access Management.

011320 2302 HowtoSendEm15 - How to Send Email from Exchange Server VM with Azure

Hope you enjoy this post.

Cary Sun

Twitter: @SifuSun

ca16fbd3199de5f66b829b87082fb970?s=80&d=retro&r=g - How to Send Email from Exchange Server VM with Azure

Author: Cary Sun

Cary Sun has a wealth of knowledge and expertise in data center and deployment solutions. As a Principal Consultant, he likely works closely with clients to help them design, implement, and manage their data center infrastructure and deployment strategies.
With his background in data center solutions, Cary Sun may have experience in server and storage virtualization, network design and optimization, backup and disaster recovery planning, and security and compliance management. He holds CISCO CERTIFIED INTERNETWORK EXPERT (CCIE No.4531) from 1999. Cary is also a Microsoft Most Valuable Professional (MVP), Microsoft Azure MVP, Veeam Vanguard and Cisco Champion. He is a published author with several titles, including blogs on Checkyourlogs.net, and the author of many books.
Cary is a very active blogger at checkyourlogs.net and is permanently available online for questions from the community. His passion for technology is contagious, improving everyone around him at what they do.

Blog site: https://www.checkyourlogs.net
Web site: https://carysun.com
Blog site: https://gooddealmart.com
Twitter: @SifuSun
in: https://www.linkedin.com/in/sifusun/
Amazon Author: https://Amazon.com/author/carysun