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.
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.
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.
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.
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.
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’.
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.
Right click on the Virtual Server Name [SMTP Virtual Server #1] and get the Properties of it.
General Tab – Nothing to do here
Access Tab. Under Authentication, Enable Anonymous and Click OK.
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.
Relay: here also the second option for me. You can specify the server too.
Massage Tab – Nothing to do here for now. You can simply customize by defining limits based on the requirements.
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.
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)
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…)
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.
Define it to use ‘Local Host’ and Save.
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.
Outbound SMTP Server (Local SharePoint Server which we enabled SMTP Services)
From and Reply to Addresses
Character Set with Defaults
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’.
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.
It will create the initial Alert right after the enabling. This Proves that Outgoing Email is now Functioning Well !
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.
Upload a sample Item and Start the Workflow.
This will trigger the mail immediately.
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’
Also the Internal Mail Server Name in the ‘Advanced’ Settings
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.
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
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.
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)
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.
- All Above Configurations are Identical for both SharePoint 2010 and 2013.
- Also There’s No single Edition wise Difference (Foundation, Standard, Enterprise). all the steps are common for all Editions of SharePoint.