Configuring Outgoing Email for Various SharePoint Environments

Configuring Outgoing email for a SharePoint Farm is one of the core thing to be done after the initial SharePoint Deployment and Configurations. You can use an Internal Mail Server or simply relay to an external Services such as Hotmail or Gmail. We will go through both ways in this Article. No purpose of referring to an External Service if you got a Mail Server in premise (e.g. – Exchange Server). Developers always prefer to use free Services like Gmail or Hotmail since having a Mail Server set up as a virtual is something consumes resources.

Scenarios

  • Using External Services (Mostly Used for Testing Purposes by Developers)
  • Using In Premise Mail Server
  • Standalone and Multi Server Farms

Initial Common Steps (Ignore if you have SMTP and IIS 6.0 Roles and features Installed and go directly to Scenarios below)

To Install SMTP Services in SharePoint Server, Open Server Manager and go to Add Roles and Features. My server in this scenario is 2012, if yours is 2008 or earlier you may do the same from Control Panel –> Programs and Features.

Go to Add Roles and Features.

clip_image001

Click Next until you get the ‘Select Features’ tab. Select the SMTP Server There. Choose Telnet Client too, you will need it to test the connectivity to SMTP Services Later.

clip_image002

Below Tab will be prompted. Simply click ‘Add’ to it. SMTP Server is usually managed from IIS 6 Interface so let it install all the required components there. Click next after the selection and it will be completed in a minutes.

clip_image003

Once Installation is done, Go to Start menu and type IIS, find the old IIS Icon which comes as second item in results. Click and it will launch the IIS 6.0 Manager.

clip_image004

Meanwhile Let’s go to Services of SharePoint Server (Open Run and type ‘services.msc’ and Enter) and find SMTP Service then make the Startup mode to ‘Automatic’ from ‘Manual’.

clip_image005

Above Steps are the common ones for any scenario.

Scenario A – Configuring Outgoing Email for SharePoint with External Service

Once you launched the IIS 6.0 it will load below Snap in.

clip_image006

Right click on the Virtual Server Name [SMTP Virtual Server #1] and get the Properties of it.

clip_image007

General Tab – Nothing to do here

Access Tab. Under Authentication, Enable Anonymous and Click OK.

clip_image008

Connection: Choose All except list below under connection. You can also specify the Server here by choosing the first option so that would be more secure.

clip_image009

Relay: here also the second option for me. You can specify the server too.

clip_image010

Massage Tab – Nothing to do here for now. You can simply customize by defining limits based on the requirements.

clip_image011

Delivery Tab – Set the Outbound Security here. Choose ‘Basic Authentication’ and define the Account details which will be used to connect to particular SMTP Server (External). Enable TLS encryption and click OK to save.

clip_image012

Outbound Connection: I have No changes here. The default Port is 25 and you have to adjust based on the Port Number used by your External SMTP Service (‘I’m Using Gmail for testing)

clip_image013

Advanced: Define the FQDN of your SharePoint Server (Local Server which runs SMTP Service) and check DNS to validate the name. Set the name of your external SMTP Service under the ‘Smart Host’ field. (Gmail – smtp.gmail.com | Hotmail – smtp.live.com etc…)

clip_image014

You can leave rest of the things such as ‘LDAP Routing’, ‘Security’ with Defaults and enable as and when requires.

Let’s Open up IIS Manager which hosts our SharePoint Web Applications (IIS 7/8). Point to Relevant Web application which we will be using Outgoing Email in SharePoint. Click on the ‘SMTP E-Mail’ Feature.

clip_image015

Define it to use ‘Local Host’ and Save.

clip_image016

That’s it from IIS 6.0 Panel. Let’s Open up SharePoint Central Administration to do the last thing. Point to ‘System Settings’ –> Configure Outgoing Email Settings’ under Email and Test Category.

clip_image017

Define the

  • Outbound SMTP Server (Local SharePoint Server which we enabled SMTP Services)
  • From and Reply to Addresses
  • Character Set with Defaults

clip_image018

That’s all on Configurations. Do a IIS Reset before we test the functionality.

Testing of Functionality.

You can either Set an Alert to a Library and if it’s sent we are good.

Login using an Account which has an Valid Email address. Create a test Library and go to Library Settings and ‘Set Alert on This library’.

clip_image019

It will prompt below snap in. it shows the Email address of the particular user. Click OK to save with default settings. Default settings will send an alert immediately based on any change you are doing to this library.

clip_image020

It will create the initial Alert right after the enabling. This Proves that Outgoing Email is now Functioning Well !

clip_image021

wp_ss_20140924_0001

Or else the other way is to Create a Simple Workflow to fire a Mail based on a Record (or something). This is a nice way to test it out. Would be robust than the alert.

Open SharePoint Designer and create a Two Step Simple Workflow like below to test.

clip_image022

Upload a sample Item and Start the Workflow.

clip_image023

This will trigger the mail immediately.

clip_image024

Scenario B – Configuring Outgoing Email for SharePoint with In Premise Mail Server.

In This scenario, SharePoint Server will relay all the outbound mail traffic to Organization’s Mail Server which may be Exchange Server.

Nothing much but only below few changes you should do after the common Configurations done.

In SMTP Server ‘Delivery’ Tab. Enable ‘Anonymous Access’ under ‘Outbound Security’

clip_image025

Also the Internal Mail Server Name in the ‘Advanced’ Settings

clip_image026

Scenario C: Deal With Standalone and Server Farms

Standalone: In The Central Administration, You can point to Local SharePoint Server in the Single Server Scenarios. Do not point to the Smart Host from Central Admin.

clip_image027

Server Farm: having SMTP Service installed and configured in one of the Frontend Server would do. Make it available in all WFE Servers if you have multiple with Load balanced so that SMTP Service will still work even if any WFE goes down in case.

Point in to the Smart Host in Server Farm Scenarios. Do not point to the Local Server

clip_image028

Important Troubleshooting Steps

1. If you are not getting any mails yet, Check the Junk Folder too, sometimes it goes there under the untrusted category

2. Keep Monitoring the Queue Folder (C:\inetpub\Mailroot\Queue) if the mails are queuing here, you got a point to check.

clip_image029

3. Sometimes External Service vendors may have changed the port for SMTP for security purposes. Check the connectivity using Telnet. This is why we install Telnet service too when we installed SMTP. Open PowerShell as Admin and run below lines (customize with Name and Port)

clip_image030

If it connects Like below, we are Cool here. Otherwise you got a point to check, may be the port number of Firewalls you have.

clip_image031

Notes:

  1. All Above Configurations are Identical for both SharePoint 2010 and 2013.
  2. Also There’s No single Edition wise Difference (Foundation, Standard, Enterprise). all the steps are common for all Editions of SharePoint.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

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