Windows SMTP Server relay through Gmail

This tutorial with show how Windows SMTP Server relay mails through Gmail or any other mail server. This is useful if your server is located on a network with dynamic IP address.

I had this issue when a monitoring software needed to send notification mails but there was no option of authenticating to the SMTP server. I installed Windows SMTP server but all my mails ware blocked by the SPAM filters. The solution was to relay all mails through a mail server.

If you are sending small number of mail this is good solution, but if your system sends a lots of mails you can be blocked by Gmail’s limits. In this case use your own mail server.

Install Windows SMTP Server

Open the Windows Server 2008 Server Manager and under Features, select Add Features

Windows 2008 Add Features

You need to check box next to SMTP Server and click Next

Windows 2008 Select SMTP feature

If you don’t have IIS 6 Management Console installed Windows 2008 will install the missing Roles for the SMTP Server to work, just click the Add Required Role Services button, and click Next on the previous screen.

Windows 2008 add required services

As you can see now it will install the IIS 6 Management Compatibility, IIS 6 Management Console and the SMTP Server. Press Install as shown on the screen.

Windows 2008 Install SMTP

Now the installation will begin and it will can take several minutes for this process to finish.

Windows 2008 SMTP installing progres
As you can see the Installation succeeded on the screen the installation of the Windows SMTP Server is complete. Press Close and we can start the configuration.

Windows 2008 SMTP installing complete

Configure Windows SMTP Relay

Open Internet Information Services (IIS) 6.0 Manager, right click SMTP Virtual server, select Properties, select the Access tab and click Relay

SMTP Access Tab

You can add here list of servers that will send mails trough this server. Click on Add to add all the servers you need, and click OK

SMTP Relay Restrictions

Select the Delivery tab and click Outbound Security…

SMTP Delivery Tab

Select Basic Authentication, enter your Gmail account (i.e. [email protected]), enter your Gmail password, check TLS encryption and press OK

SMTP Outbound Security

Select the Delivery tab and click Outbound connections…

SMTP Delivery Tab

Set TCP port to 587 and click OK

SMTP Outbound Connections

Select the Delivery tab and click Advanced…

SMTP Delivery Tab
Enter the Full-quailified domain name – this should be what you want this SMTP server to be called. If your server name is SMTP and your domain is YOURDOMAIN.COM then the entry should be
Enter as the Smart host and click OK

SMTP Advanced Delivery

Now you can configure your servers to use as SMTP server and it will relay the mails trough your Gmail account.

One final note: Don’t forget to set the Simple Mail Transfer Protocol (SMTP) service to start automatically. Start your Services console, right click Simple Mail Transfer Protocol (SMTP), select Properties and change Startup type: Automatic

SMTP Services Automatic

You need to have Gmail Account or create one at:
Enable the Gmail account for POP3 in Gmail, you can follow the instructions on how to do this here:

Notify of
Newest Most Voted
Inline Feedbacks
View all comments
Dmitry Streltsov
Dmitry Streltsov
6 years ago

Change pls “Windows” for “Windows Server” in title

William Foresman
6 years ago

now mail sent from my server uses the email address entered to auth as the FROM address sending the emails???

6 years ago

As i remember the FROM address will be the address you enter as From address on your mailer. But you should try because your mails can be seen as spam if you send from other domain not

William Foresman
6 years ago
Reply to  nstojanoski

unfortunately, it changes the from address to whatever account you use to auth smtp.

4 years ago

Thanks for this article
It helped me with “”, as a local domain essential for sending email.