How to: Setup SMTP service on Windows Server 2012 R2

Many services and apps require some kind of email server in order to send you email notifications, warnings, errors. Windows Server 2012 doesn`t pack Exchange Server with it, but there is simple solution for sending emails from Windows Server 2012 and here is the tutorial for setting it up.

Prerequisite for this tutorial is installed IIS with IIS 6.0 Management Tools

Search | Server Manager | click on Server Manager

server_smtp_1

Click on Manage | Add Roles and Features |Next

server_smtp_2

Role-based of feature-based installation | Next

server_smtp_3

Select server | Next

server_smtp_4

Next | (Select Web Server and all under Management tools if you don`t already have IIS installed)

server_smtp_5

Select SMTP Server under Features

server_smtp_6

New Window will pop-up |Add Features

server_smtp_7

Next

server_smtp_8

Install

server_smtp_9

Success | Close

server_smtp_10

Back to search – enter IIS and then click on Internet Information Services (IIS) 6.0 Manager

server_smtp_11

Expand your local server and right click on SMTP | click on Properties

server_smtp_12

General tab |IP address – select local machine IP address and enable logging |Apply

server_smtp_13

Access Tab | click on Connection button

server_smtp_14

Click on Only the list below |Add

server_smtp_15

Enter IP of the computer you want to be able to access to SMTP service (you will define all local IPs here that you want to access your SMTP)

server_smtp_16

OK

server_smtp_19

Now, back to Access tab | click on Relay button

server_smtp_18

Same procedure as for Connection |OK |Apply

server_smtp_17

Delivery tab |click on Advanced button

server_smtp_20

Under fully-qualified domain name enter name of external mail server. If you have the need – you`ll also enter smart host name. After you’re done – OK |Apply |OK

server_smtp_21

Last stop is the firewall

Enter Firewall in search |select Windows Firewall with Advanced Security

server_smtp_22

!In some scenarios, you`ll also have to define Outbound Firewall Rule (same procedure as described here for inbound rule)

Right click on Inbound Rules | New Rule

server_smtp_23

Select Port | Next

server_smtp_24

TCP | Specific Local ports: enter 25 | Next

server_smtp_25

Allow the connection | Next

server_smtp_26

I`ll open my SMTP port to all instances, Public interface is not recommended, so choose wisely and think about what you want to achieve. This is my test lab, so I don`t have any security issues with it and want to test some scenarios. Next

server_smtp_27

Write the Name and description for your rule | Finish

server_smtp_28

Rule is created

server_smtp_29

Go to Control Panel | Administrative Tools | Services | find Simple Mail Transfer Protocol (SMTP) and set startup to Automatic (right click on it – Properties – Startup Type – Automatic)

server_smtp_30

Restart service (or even better – server is you can) and test your SMTP with application or service you want notifications from.

 

Disclaimer