This article will guide you through installing and setting up an SMTP server on a Windows Server. This allows your Windows based server to send email directly and commonly used when local applications need to send email notifications.

Enabling SMTP Feature

  1. Connect to your server via Remote Desktop
  2. Open Server manager:
  3. Click Manage then Click Add Roles and Features:
  4. Click Server Selection:
  5. Click Features:
  6. Scroll until you find SMTP Server.
  7. Tick the box to the left of SMTP server:

    A popup will appear advising on addition features required.
  8. Click Add Features:
  9. Click Next, then click Install.
  10. Wait for the SMTP feature to complete installation then click Close:

Configuring the SMTP server

We now need to configure the SMTP server to only allow emails from the local server, this will help prevent spammers using your SMTP server to send spam.

  1. Open the IIS 6 application
  2. Expand the server name so the SMTP server is visible:
  3. Right click on the SMTP server and select Properties:
  4. Tick Enable Logging:
  5. Next under the Access tab Open Authentication:
  6. Ensure Anonymous Access is enabled:
  7. Still under the Access Tab select Connection:
  8. In the popup select Only the list below and Click Add:
  9. Under Single Computer enter the IP Address and click OK:
  10. Click OK again to close the connection window:
  11. Next click Relay:
  12. Once again select Only the list below and click Add:
  13. Under Single Computer enter the IP Address and click OK:
  14. Click Apply to save your changes:
  15. Under the Delivery tab select Outbound Connections:
  16. Set Limit number of connections and Limit number of connections per domain to 25. TCP port should remain as 25:
  17. Click OK.
  18. Click Apply to save your changes again:
  19. Under the delivery tab click Advanced:
  20. Set the Fully-Qualified domain name to the hostname of your server. EG: server.yourdomainname.help
  21. Click OK.
  22. Click OK again to close the setup window.

Confirming your configuration is working

We now need to confirm the configuration is working

  1. Open a PowerShell Window on the server.
  2. Enter the below PowerShell code, replacing “” with an email address associated with the domain you wish to send from.
Send-MailMessage -SMTPServer localhost -To  -From  -Subject "This is a test email" -Body "Hi, this is a test email sent from your Windows Server"
  1. Press Enter.
  2. Check the mailbox you have used in the above code example, the email should arrive if not blocked by any spam filtering services and configuration is correct.


We recommend updating your SPF record for the sending domain to prevent your email being marked as potential spam.

This can be done by adding an ip4:<your server ip here> into the SFP TXT record at your DNS host

Was this article helpful?

Related Articles