Step By Step Configuring SharePoint Outgoing Email for Various 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.
https://manojviduranga.files.wordpress.com/2014/09/clip_image001_thumb1.png?w=228&h=151
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.
https://manojviduranga.files.wordpress.com/2014/09/clip_image002_thumb1.png?w=541&h=412
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.
https://manojviduranga.files.wordpress.com/2014/09/clip_image003_thumb1.png?w=409&h=373
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.
https://manojviduranga.files.wordpress.com/2014/09/clip_image004_thumb1.png?w=644&h=138
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’.
https://manojviduranga.files.wordpress.com/2014/09/clip_image005_thumb.png?w=630&h=139
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.
https://manojviduranga.files.wordpress.com/2014/09/clip_image006_thumb.png?w=564&h=155
Right click on the Virtual Server Name [SMTP Virtual Server #1] and get the Properties of it.
https://manojviduranga.files.wordpress.com/2014/09/clip_image007_thumb.png?w=368&h=328
General Tab – Nothing to do here
Access Tab. Under Authentication, Enable Anonymous and Click OK.
https://manojviduranga.files.wordpress.com/2014/09/clip_image008_thumb.png?w=381&h=484
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.
https://manojviduranga.files.wordpress.com/2014/09/clip_image009_thumb.png?w=373&h=209
Relay: here also the second option for me. You can specify the server too.
https://manojviduranga.files.wordpress.com/2014/09/clip_image010_thumb.png?w=377&h=303
Massage Tab – Nothing to do here for now. You can simply customize by defining limits based on the requirements.
https://manojviduranga.files.wordpress.com/2014/09/clip_image011_thumb.png?w=398&h=423
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.
https://manojviduranga.files.wordpress.com/2014/09/clip_image012_thumb.png?w=393&h=404
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)
https://manojviduranga.files.wordpress.com/2014/09/clip_image013_thumb.png?w=374&h=175
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…)
https://manojviduranga.files.wordpress.com/2014/09/clip_image014_thumb.png?w=376&h=338
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.
https://manojviduranga.files.wordpress.com/2014/09/clip_image015_thumb.png?w=552&h=246
Define it to use ‘Local Host’ and Save.
https://manojviduranga.files.wordpress.com/2014/09/clip_image016_thumb.png?w=592&h=412
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.
https://manojviduranga.files.wordpress.com/2014/09/clip_image017_thumb.png?w=714&h=160
Define the
- Outbound SMTP Server (Local SharePoint Server which we enabled SMTP Services)
- From and Reply to Addresses
- Character Set with Defaults
https://manojviduranga.files.wordpress.com/2014/09/clip_image018_thumb.png?w=644&h=324
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’.
https://manojviduranga.files.wordpress.com/2014/09/clip_image019_thumb.png?w=557&h=350
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.
https://manojviduranga.files.wordpress.com/2014/09/clip_image020_thumb.png?w=439&h=484
It will create the initial Alert right after the enabling. This Proves that Outgoing Email is now Functioning Well !
https://manojviduranga.files.wordpress.com/2014/09/clip_image021_thumb.png?w=644&h=168
https://manojviduranga.files.wordpress.com/2014/09/wp_ss_20140924_0001_thumb.jpg?w=292&h=484
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.
https://manojviduranga.files.wordpress.com/2014/09/clip_image022_thumb.png?w=757&h=208
Upload a sample Item and Start the Workflow.
https://manojviduranga.files.wordpress.com/2014/09/clip_image023_thumb.png?w=667&h=388
This will trigger the mail immediately.
https://manojviduranga.files.wordpress.com/2014/09/clip_image024_thumb.png?w=241&h=117
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’
https://manojviduranga.files.wordpress.com/2014/09/clip_image025_thumb.png?w=389&h=400
Also the Internal Mail Server Name in the ‘Advanced’ Settings
https://manojviduranga.files.wordpress.com/2014/09/clip_image026_thumb.png?w=392&h=381
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.
https://manojviduranga.files.wordpress.com/2014/09/clip_image027_thumb.png?w=561&h=298
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
https://manojviduranga.files.wordpress.com/2014/09/clip_image028_thumb.png?w=556&h=306
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.
https://manojviduranga.files.wordpress.com/2014/09/clip_image029_thumb.png?w=639&h=94
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)
https://manojviduranga.files.wordpress.com/2014/09/clip_image030_thumb.png?w=452&h=97
If it connects Like below, we are good here. Otherwise we got a point to check such as firewall rules for SMTP port etc...
https://manojviduranga.files.wordpress.com/2014/09/clip_image031_thumb.png?w=364&h=104
Notes:
- 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.