Any SharePoint Client, User, or Developer need an SMTP server to send e-mails to Internal or External SharePoint site users from a Workflow, Alerts, Request Site Access, and/or Any custom Apps that use SharePoint Outgoing e-mail setting to send e-mails.
SharePoint cannot be configured to send e-mail over encrypted port to the e-mail service. And Office 365 and Gmail required an SMTP connection that supports TLS encryption .
Fortunately, Windows Server (2008-2012) supports an SMTP relay for Office 365 and Gmail by install a local SMTP Rely Server that supports an encrypted connection (over TCP Port 587) .
The Steps are easy and forward:
-
Install SMTP Role (Windows Server 2008 and 2012)
-
Configuring SMTP Service to Relying to Office365/Gmail SMTP
-
Testing the SMTP Service Connection
-
Configuring Outgoing E-Mail settings in SharePoint Servers
-
Test Sending an E-mail from SharePoint Site
The following is the detailed steps:
Install SMTP Role
Windows Server 2008
-
Open Server Manager and select Add Roles and Features.
-
On the Select Features screen, choose SMTP Server. You may be prompted to install additional components. If that’s the case, select Add Required Features and select Next.
-
Select Install
Windows Server 2012
-
Open Server Manager and select Add Roles and Features.
-
Select Server Selection and make sure that the server that will be running the SMTP server is selected and then select Features.
-
On the Select Features screen, choose SMTP Server. You may be prompted to install additional components. If that’s the case, select Add Required Features and select Next.
-
Select Install.
Configuring SMTP Service to Relying to Office365/Gmail SMTP
-
Open Administrative Tools > and Click on Internet Information Services (IIS) 6.0
- Right-Click the [SMTP Virtual Server #1], and then select Properties
- In Properties window, Click on Access tab
- In Access tab, Do the Following
- in Access Control, Click on Authentication button
- Make sure Anonymous Access is checked, and click OK button
- in Access tab again, Click on Connection button
- Select which servers can connect to this virtual SMTP server, by default it is set to accept all. But we need to granting only localhost (127.0.0.1) access and all SharePoint Servers that will send emails using local SMTP server, this will limits only the server itself the ability to connect to the SMTP server. This is a requirement for security.
-
Select which computer can relay through this SMTP, only allowing the localhost IP address (127.0.0.1) and all SharePoint Servers that will send emails using local SMTP server a relay permissions and it means that only the SMTP server itself can relay mail. This will prevents other computers on the internet to use your SMTP server and send spam emails which will lead your SMTP server to be BLACKLISTED
- in Access Control, Click on Authentication button
-
Now go to next tab, Messages tab, and change the limit message size to 10 MB. Then enter the email address where copies of non-delivery reports are sent to.
-
Go to next tab, Delivery tab, and do the following:
-
Click on Outbound Security and enter the mail account credentials that will be used to send messages.
-
Select Basic Authentication, and enter the Gmail/Office 365 account username and password, and make sure to select TLS Encryption checkbox. Click on OK.
-
In Delivery tab again, click on Outbound Connections. We need to tell the server to use TCP port 587 when attempting to connect to Office 365/Gmail
-
Here you will provide FQDN name of your domain and smart host, set the smart host to (smtp.office365.com) for using Office 365 SMTP, or (smtp.gmail.com) for using Gmail SMTP. Finally, clear the option to Attempt direct delivery before sending to smart host
-
Click on OK, and Apply changes. This completes our SMTP level configuration
Testing the SMTP Service Connection
- Create a Notepad file and enter the following
To:username@outlook.com
From:username@TempDomain.onmicrosoft.com
Subject: Test E-Eail SMTP Rely
This is a test email sent from my SMTP server (Office 365/Gmail) - Save the Notepad file as email.txt
- Navigate to C:\inetpub\mailroot\Pickup
- Copy the email.txt from the desktop and paste it into the Pickup folder. It should disappear and send the email.
- Confirm the the Queue folder is empty (no stuck emails) after sending the message, and you have received the test email.
- Office 365 rely email message
- Gmail rely email message
Configuring Outgoing E-Mail settings in SharePoint Servers
-
Go to Central Administration –> System Settings –> Configure Outgoing Email Settings
-
Enter the FQDN of the local SMTP server (Mail.Dev.local)
-
Click on Apply, and Reset the IIS (CMD –> IISRESET)
Test Sending an E-mail from SharePoint Site
In SharePoint Team site, I enable E-Mail Notification when a task assigned to user in a Task List
So, I create a new task and assigned it to me, and waiting to receive the task notification email
I receive the Task notification email successfully and it is works great
I hope this is will be useful for you
jesusguz29
April 18, 2016 at 7:57 pm
Thanks for sharing!!
I have configured the SMTP at the domain (mydomain.xxx.xxx), and all goes good. Because the email can be sent when I create a test TXT file and drop it into PICK UP folder of the MailRoot.
In the “Outbound SMTP Server” of Central Administration, I enter (mydomain.xxx.xxx) There is no email sent after I set up the alert. I see the error “Cannot connect to SMTP host “mydomain.xxx.xxx” in the Windows Event log.
I also tried to send and email from PowerShell cmdlet, but it fails.
I really appreciate your help.
Jason Bailey
August 16, 2016 at 4:18 am
your smtp host isn’t your domain, so would be something like smtp.mydomain.local depending on what you called when creating it.
Henricus
August 18, 2016 at 7:52 pm
Thanks Jason. I am a bit unclear where the mail.dev.local comes from. Is that the name of the server on which the new SMTP server is configured?
Ammar Azeem
October 17, 2016 at 11:05 am
Thanks Alot. Your Step by Step elaboration help me alot in configuration of Local SMTP
Cheers
Rahul
February 18, 2017 at 4:13 pm
Hi Mr. Ali,
Thanks for the sharing the content.
I followed the above process and was able to send a mail at the very first instance when SMTP was configured.
But, when I tried after 4 hours, no mail was triggered.
I confirm that there were no changes made in the settings.
Can you please tell me the possible reason because of which I might be facing the issue?
Thanks.
Best Regards,
Tushar
Ready2Learn For Pakistan (Learn from every thing.)
March 2, 2017 at 9:19 am
This is very awesome and well explained article showing clearly all steps. Thanks for your time Sir.
Now i am going to try all steps.
JoeMac
July 19, 2017 at 10:48 pm
Thank you for the time in establishing these steps –
I do however have an open question – I have followed the steps outlined and can confirm that I have the SMTP process configured properly as I can send test messages from the SharePoint server to my corporate Outlook folder… However when I attempt to execute a list “E-mail a Link” or establish an email “Alert Me”, I receive a pop-up error message indicating “No apps are installed to open this type of link(mailto)”
Any assistance that you may be able to provide is greatly appreciated in advance…
gogi100
January 10, 2018 at 9:01 pm
hi, can I use some others smtp server instead gmail relay or office 365. I have my mail server but I cannot use your configuration. can I configure specially my smtp server
oswaldjayatunge
February 28, 2018 at 7:19 pm
Thank you. Works like a charm. Great tutorial!