Posted on May 19, 2016 · Posted in Windows Server 2012 R2

How to Install and Configure SMTP Server on Windows Server 2012 R2

On all versions of Windows Server, you can setup built-in SMTP server. This SMTP server inside the organization can serve as a mail relay receiving and sending SMTP messages from and to different devices (like senders, scanners,  access control devices, etc.) and applications (web applications, SQL Reporting Services, SharePoint), which need an opportunity to send mail using an SMTP service. It is not always rational to deploy a full-featured mail infrastructure, like Microsoft Exchange Server or other mail services.

In this article we’ll show how to install, configure and test the SMTP server on Windows Server 2012 R2 serving as a mail relay. This SMTP server can only send or forward e-mails, it doesn’t have any means to receive them.

How to Install SMTP Service in Windows Server 2012 R2

SMTP server is one of the system features that can be installed through Server Manager. To do it, open Server Manager Dashboard (servermanager.exe), go to Add roles and features and check SMTP Server when you select the features. To manage the SMTP service, install management consoles, being a part of Web Server (IIS) role, so you will be prompted to install some IIS components.

SMTP server feature on Windows Server 2012 R2

Leave all the suggested options of Web Server (IIS) role and run installation.

IIS 6 Managment Tools

After the components are installed, you may need to restart your computer.

SMTP Server Configuration

The SMTP server is still managed using the old school management console Internet Information Services (IIS) Manager 6. You can open this console in Server Manager: Tools-> Internet Information Services (IIS) 6.0 Manager or with the command inetmgr6.exe

console Internet Information Services (IIS) Manager 6 console

In IIS 6 Manager unfold the branch with your server name, right-click SMTP Virtual Server and open its properties.

SMTP Server properties

In the General tab, if necessary select the IP address, the SMTP server to respond to, and check Enable logging.

SMTP Virtual Server Settings

Then go to the Access tab.

smtp access tab

Here click Authentication and make sure that the Anonymous access is enabled.

SMTP Authentication Settings: Anonymous access

Go back to the Access tab and click Connection. Here you can specify, which devices can send e-mails using our relay. To do it, check Only the list below and enter the list of IP addresses, don’t forget about yourself (

smtp allow ip list

Note. As a general rule, it’s worth to check this option and limit the list of accepted devices with the range of IP addresses. Otherwise, your SMTP server may be used by spammers and other hackers as an open relay.

Go to the Messages tab. Here the administrative e-mail address is specified, to which the copies of NDR messages will be delivered, as well as the restrictions of the maximum e-mail size and the number of recipients.

messages limits

Go to the Delivery tab.

delivery options

Then click Outbound Security. Here you specify the way of authentication on the external mail server. For example, if all e-mails will be forward  to Gmail mail server and then resent to the recipients, check Basic authentication and specify the login and password of your Gmail mailbox (In Google account settings should be allowed to send mail through their SMTP servers).

Outbound security: anonymous access

Then click Advanced.

Advanced delivery options

Here you specify the FQDN name of your SMTP server. Click Check DNS to make sure if the DNS record is correct.

the domain name is valid

If your server sends mail to an external SMTP server, specify its name in Smart host field (e. g.,

Save the settings of the SMTP server.


  1. DNS settings are critical from the point of view of mail system availability. If your SMTP server cannot resolve names, to which e-mails are sent, the delivery won’t be possible.
  2. If your server sends mail to other domains, it is important that the correct PTR record is created for your IP address to resolve reverse DNS lookup. The PTR record for an external IP address has to point at the FQDN name. Otherwise, most external SMTP servers won’t get mail from you, considering your server a spammer one.

SMTPSVC Automatic Start up

Now you only have to configure the automatic startup of your SMTP server. You can do it quickly using PoSh command prompt:

set-service smtpsvc -StartupType Automatic

Start the service:

start-service smtpsvc

Make sure that SMTPSVC is running:

get-service smtpsvc

Status   Name               DisplayName
——   —-               ————
Running smtpsvc           Simple Mail Transfer Protocol (SMTP)

Start smtpsvc service

SMTP Server Testing

The last thing you have to do is to make sure that your SMTP server is working. It is easier to do it by creating a plain-text file smtp-test-email.txt on your desktop and copying the following text to it. Don’t forget to change the sender and recipient names to yours.

Subject: Email test
This is the test email

smtp test email

Copy smtp-test-email.txt to C:\inetpub\mailroot\Pickup. SMTP server monitors new files appearing in this folder, and if a file is found it will read it and try to send an e-mail with the given subject and body to the recipient specified in the To: line.

Check the recipient mailbox, and you will see this e-mail.

test email in outlook

Tip. You can also test the work of your SMTP server using telnet command prompt, VBS script or PowerShell:

Send-MailMessage -SMTPServer localhost -To -From -Subject "Email test" -Body " This is the test email from PowerShell"

So we have configured our own SMTP mail relay in Windows Server 2012 R2 and and tested sending messages through it.

Related Articles