How to setup Gmail as SMTP Relay Server in SharePoint?

Emails are one of the important functionalities of SharePoint. Often when we create our own development environment we have to create our own SMTP server or rely on our company’s SMTP server (which may not be accessible outside company’s firewall).

My preferred route is to use Gmail as SMTP relay server because it is easy to setup up, free and my development environment can be completely isolated from my company’s infrastructure. We just need a valid Gmail account and our development environment should be connected to Internet. J

Here are the steps.

  1. Sign up for Gmail account if you don’t have one.
  2. Change the settings of the Gmail account and turn on the access to the less secure apps.
  3. Login to the SharePoint server (Windows 2008/2008 R2/2012/2012 R2) using admin account. The screen shots in this blog post are taken from Windows Server 2012 R2. If have already installed the SMTP server then skip the steps till 15.
  4. Install feature “SMTP Server” using server manager. Open the server manager.

  5. Click on “Add roles and features”.

  6. Click Next.

  7. Select the “Role-based or feature-based installation” and click next.

  8. Select the “Select a server from the server pool” and click next.

  9. Click Next in the “Server Roles”.

  10. Scroll down and select “SMTP Server”.

  11. A pop will show up to install the pre requisites. Click on “Add Features”.

  12. Click Next.

  13. Confirm the installation by click “Install”. The installation will take 2-5 minutes depending the server resources.

  14. We will see following message after successful installation. Click “Close” to exit the wizard.

  15. Now search for IIS 6.0 in the Search bar.

  16. Expand the “Local Computer” and Right click on the “SMTP Virtual Server” and then click Properties.

  17. Click on the “Access” Tab.

  18. Under “Relay Restrictions” click on “Relay”.

  19. Select the Check Box “All except the list below” and then click “OK”.

  20. Then click on the “Messages” tab and make sure following settings are there.
    1. Limit messages size to (KB) = 2048
    2. Limit session size to (KB) = 10240
    3. Limit number of messages per connection to : 20
    4. Limit number of recipients per message to: 100
    5. Badmail directory : C:\inetpub\mailroot\BadmailA

  21. Click on the “Delivery” tab and then click on “Outbound Connections”.

  22. Select 587 as TCP port instead of default 25 and then click “OK”.

  23. Click on “Outbound Security”.

  24. Select “Basic authentication”. In the user name enter valid Gmail address and the corresponding password of the Gmail account. Select the check box of “TLS encryption” and then click OK.

  25. Click on “Advance”.

  26. Enter the following information and then click OK.
    1. Maximum hop count: 15
    2. Fully-qualified domain name: FQDN of the server. If
    3. Smart host : smtp.gmail.com

  27. Click “OK” and Apply and then OK.

  28. Now open the Central Administration ->System Settings->Configure outgoing e-mail settings. The following screen shots are from SharePoint 2013. The same steps can be used in SharePoint 2010.

  29. Enter the fully qualified domain name of the server in the “Outbound STMP server” and then click “OK”.

  30. To test the outgoing emails are working, setup “Out Of The Box” alert on any SharePoint list or library.

Happy Learning. J

Advertisements

About pgbhoyar

Prashant G Bhoyar is Microsoft Certified Professional and currently working as a Senior Consultant at Portal Solutions LLC. He specializes in development and post-implementation adoption of complex custom solutions. Prashant has supported many government agencies and non-profit organizations in the Washington D.C. metropolitan area. Prashant was the technical reviewer of the book "Pro SharePoint 2013 Administration." He is the organizer of the Baltimore SharePoint User Group and a Baltimore SharePoint Saturday event. He actively speaks at SharePoint events across the country, most recently in New York, Boston, Chicago, Orlando, Baltimore, Philadelphia, as well as, at many events throughout the Washington D.C. metropolitan area. Prashant is a recipient of the "Antarctic Service Medal of the United States Of America" for his outstanding service in Antarctica.
This entry was posted in SharePoint 2013, SharePoint 2013 Administration and tagged , , . Bookmark the permalink.

One Response to How to setup Gmail as SMTP Relay Server in SharePoint?

  1. Great stuff again. Thanks for making time to write these articles. You will be my number one resource, Looking forward to more articles

    Like

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s