SMTP4DEV – SMTP Server Tool to Test SharePoint 2013 Outgoing E-Mails

What is SMTP4DEV?
Well, SMTP4Dev is a nifty tool for capturing and testing Emails from any application. It doesn’t actually send any Emails to the actual recipients, but it captures Emails triggered from applications such as SharePoint. Here is how we can utilize this tool for testing outgoing Emails from SharePoint.

This is extremely helpful in development environments and for testing purposes.

Step 1: Download the SMTP4DEV Tool
Download the SMTP4DEV tool: smtp4dev, Standalone also available! Just click and run the tool.

Step 2: Set Domain name in the tool
This tool runs from the system tray area. The first thing you have to set is: configure the domain name as your current server name (by default it will be localhost). 

  • Go to options >> Under the Server tab, set the domain name accordingly.
    smtp4dev sharepoint 2010

Step 3: Configure the Outgoing Email settings in Central admin
Now in SharePoint 2013 (or in SharePoint 2010), set the outgoing email settings from SharePoint central administration site.

  • Central Administration >> System Settings >> Configure outgoing e-mail settings >> add the same machine name in smtp4dev
    smtp4dev sharepoint 2013

Make sure that the domain name provided in smtp4dev tool and the Outgoing Email settings in SharePoint central Admin are same.

Step 4: Write code / Set Alerts in SharePoint to trigger E-mails
Now, You can write your custom code/event receiver/workflow/Create alerts to send Emails from SharePoint. Here is my sample code to trigger Email with SPUtililty.SendMail using PowerShell:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$siteUrl ="https://intranet.crescent.com"

$Web = Get-SPWeb $siteURL
 
$mail = [Microsoft.Sharepoint.Utilities.SpUtility]::SendEmail($web,0,0,"salaudeen@crescent.comn","Subject of the Mail","mail body")

Here is the output:
As soon as an Email triggered from SharePoint, This tiny tool starts blinking, and you should see messages appear in SMTP4Dev!
smtp4dev sharepoint
You can inspect the Email from the tool and open mails with any Email client such as Outlook.

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *