Lo script va eseguito dalla PowerShell di SharePoint in modo da avere i plug-in caricati:
PowerShell
#recupero un web da passare alla SendMail
$w =Get-SPWeb http://sharepoint.sgart.local

#invio la mail
$appendHtmlTag = $false
$htmlEncode = $false
$sender = "sharepoint@sgart.local"
$subject = "Test invio mail"
$body = "Inserire un testo che NON venga bloccato dai filtri spam"

[Microsoft.SharePoint.Utilities.SPUtility]::SendEmail($w, $appendHtmlTag, $htmlEncode, $sender, $subject, $body)
Se tutto va a buon fine il metodo SendMail deve ritornare True
Potrebbe interessarti anche: