Send email from PowerShell

Sending an email from PowerShell

It’s easy to send an email from PowerShell, and it’s really useful for notifying yourself of the completion of a long-running script. It’s also a way to document what ran when, if you are like me and running hundreds of scripts and need a way to organize documentation on when you run things. Just alter the parameters below, and let ‘er rip and spam yourself!

[string] $From = "",
[string] $To = "",
[string] $Title = "title",
[string] $Body = "body"
$SmtpClient = New-Object System.Net.Mail.SmtpClient
$SmtpServer = ""
$ = $SmtpServer