Categories
Uncategorized

Send test email from SharePoint

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

Run the following code with SharePoint Management Shell

[code lang=”PowerShell”]
$email = "test@test.com"
$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
[/code]