How to Send Email from Powershell in SharePoint 2010/2013/2016/2019 & Office 365?

Hello SharePointers,

Below are the Powershell script to send email from powershell in SharePoint 2010/2013/2016/2019 & Office 365.

$DicObject = New-Object System.Collections.Specialized.StringDictionary
$DicObject .Add(“to”,””)
$DicObject .Add(“from”,””)
$DicObject .Add(“subject”,”Test Email”)
$web = Get-SPWeb
$body = “This is a test email Friends”

try {
[Microsoft.SharePoint.Utilities.SPUtility]::SendEmail($web,$DicObject ,$body)
finally {

Happy SharePointing 🙂

Leave a Reply

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