SharePoint Powershell command to verify if the Outgoing Email Functions in Sharepoint Environment
(Send Test Email Form SharePoint)
One can simply test outgoing email from SharePoint.
Run the following code with SharePoint Management Shell (run as administrator)
Command:
$email = "Receiver@email.com"
$subject = "Subject Of Email"
$body = "Body Of Email, Test Text for 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
-----------------------------------------------------------
If its true then the email will be delivered.
If its false then the email functionality does not work in the SharePoint box.