SharePoint Powershell command to verify if the Outgoing Email Functions in Sharepoint Environment

(Send Test Email Form SharePoint)

One can simply test outgoing email from SharePoint.

With PowerShell you can send a test email from within SharePoint.
Run the following code with SharePoint Management Shell (run as administrator)
Command:

$email = “Receiver@email.com”
$subject = “Subject Of Email”
$body = “Body Of Email, Test Text for Body”

$site = New-Object Microsoft.SharePoint.SPSite “http://sharepoint”
$web = $site.OpenWeb()
[Microsoft.SharePoint.Utilities.SPUtility]::SendEmail($web,0,0,$email,$subject,$body)

// A True or False will confirm the message has been sent or not

———————————————————–
If its true then the email will be delivered.
If its false then the email functionality does not work in the SharePoint box.

By Rijwan Ansari

MVP, CSM, CSPO, MCP, MCTS. Sr. Software Developer. Expertise in ASP.NET MVC, Angular, AngularJs, .Net Core, C#.NET, Azure, Cognitive Services, Machine Learning, SharePoint, Azure Services, and tools, Requirement Analysis, Team Management, Pre-Sales and more. Ability to work independently and Team, handle pressure and meet commitment. Excellence Communication and adjust in any environment

Leave a Reply

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