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.

With PowerShell you can send a test email from within SharePoint.
Run the following code with SharePoint Management Shell (run as administrator)

$email = “”
$subject = “Subject Of Email”
$body = “Body Of Email, Test Text for Body”

$site = New-Object Microsoft.SharePoint.SPSite “http://sharepoint”
$web = $site.OpenWeb()

// 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.