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

About pgbhoyar

Prashant G Bhoyar is a Microsoft AI MVP and Microsoft Certified Professional. He currently works as a Senior Solution Architect at WithumSmith+Brown, P.C. (formerly Portal Solutions), one of the top 30 advisory and accounting firms in the United States. He is a trusted advisor and Subject Matter Expert in Intelligent Business Process Automation, development and post-implementation adoption of complex custom solutions in AI, Machine Learning, Bots, Azure, Office 365, and SharePoint. Prashant has supported a multitude of government agencies and non-profit organizations in the Washington D.C. metropolitan area. Prashant is the co-author of the book “PowerShell for Office 365 “and is the technical reviewer of the book "Pro SharePoint 2013 Administration." He serves on the leadership committee for the Azure Data Fest conference, Artificial Intelligence Fest conference, Artificial Intelligence and Machine Learning User Group, DC Metro Office 365 User Group, SharePoint Saturday Baltimore event, and SharePoint Saturday Washington DC event. He is a renowned international speaker and actively speaks at technical conferences, most recently in India, Canada, England, Bangladesh, Peru , Washington DC, Austin, New York, Chicago, Seattle, New Orleans, Baltimore, Philadelphia. Fun fact??, 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.

1 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 )

Facebook photo

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

Connecting to %s