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
You need to check box next to SMTP Server and click Next
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.
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.
Now the installation will begin and it will can take several minutes for this process to finish.
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.
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
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
Select the Delivery tab and click Outbound Security…
Select Basic Authentication, enter your Gmail account (i.e. [email protected]), enter your Gmail password, check TLS encryption and press OK
Select the Delivery tab and click Outbound connections…
Set TCP port to 587 and click OK
Select the Delivery tab and click Advanced…
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 smtp.yourdomain.com
Enter smtp.gmail.com as the Smart host and click OK
Now you can configure your servers to use smtp.yourdomain.com 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
You need to have Gmail Account or create one at: http://www.gmail.com
Enable the Gmail account for POP3 in Gmail, you can follow the instructions on how to do this here: http://mail.google.com/support/bin/answer.py?answer=13273&cbid=wl8yzeug2lob&src=cb&lev=topic