23 June 2015 | Cloud Computing

Setting up a SMTP Server on an Azure Virtual Machine

Author: John Doyle

12/01/2017 UPDATE: It is Against the Azure Terms of Service to use a VM to send out emails. Microsoft recommends you use a third party email sender.

Today I had an interesting challenge. It was to set up a SMTP server on an Azure virtual machine for a client who were moving to the cloud.

As we all know Microsoft likes to lock down or change certain settings on us when using their cloud services so hopefully this guide will help someone when setting up their SMTP on an Azure VM.

Here is the steps I needed to do in order to get SMTP server working on the Azure virtual machine.

  1. Install SMTP via Server Manager > Manage > Add Roles and Features
  2. Click Next until you reach “Server Roles”
  3. Tick Web server
  4. Click Next
  5. Tick SMTP
  6. After Installation Open IIS 6.0 Manager
  7. Right Click on SMTP Virtual Server and click properties
  8. Pick the VMs local IP address (Should be only one in drop down)
  9. Click Access Tab
  10. In the “Connection” and “Relay” screens select “All Except the list below”
  11. undefined
  12. Click Apply and OK
  13. Go to Services
  14. Right Click “Simple Mail Transfer Protocol”
  15. undefined
  16. Set the startup type to Automatic
  17. Click Apply
  18. Stop and Start the Service
  19. Click OK
  20. In your Web configs ensure to change any SMTP Server values from “localhost” to the name of the Azure VM e.g. “DovetailExampleVMName” This is the name you used when you first created the Virtual Machine on the Azure portal.
  21. Test your SMTP server

Hope this helps some people who are having trouble porting some websites over to an Azure virtual machine that used SMTP on their server. 

Call us!

Whether you have a specific need now or would like to explore, in general,
how custom software solutions might support your progress we'd love to talk.

Request a Callback