How to send Email by using Powershell in SharePoint

Leave a Comment
Hi All,

In a following post we will see how to Send an Email by Using Power shell Script. Before execute the below Command make sure the below Configurations are configured Properly,

1. SMTP is Configuration
2. Out going Email Configuration in Central Administration


Add-PSSnapin Microsoft.SharePoint.Powershell
//To Email Address
$email="Username@Sharepointkitchen.com";
//Email BODY
$body="sample email body";
$subject="Test Subject";
//Get Web Instance
$web=Get-SPWeb "http://Sharepointkitchen:8500";
[Microsoft.SharePoint.Utilities.SPUtility]::SendEmail($web,0,0,$email,$subject,$body);
After executing the above script from PS , It will return the Status as TRUE, means Email has been sent Successfully.
Thanks.

Related Post

0 comments:

Post a Comment