Send test email from SharePoint

February 12th, 2013 | Posted by Jeffrey Paarhuis in Uncategorized

With PowerShell you can send a test email from within SharePoint.

Run the following code with SharePoint Management Shell

$email = "[email protected]"
$subject = "Test subject"
$body = "Test 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

You can follow any responses to this entry through the RSS 2.0 You can leave a response, or trackback.

4 Responses



Leave a Reply

%d bloggers like this: