Sending an email using PowerShell is very easy. You just need to know about your SMTP Server. Here is how the script looks like…
$message = "This is your message!"
$severety = "[WARNING] "
$EmailTo = "firstname.lastname@example.org"
$EmailCC = “email@example.com”
Send-mailmessage -to $EmailTo -Cc $EmailCC -from "firstname.lastname@example.org” -subject "$severety $message" `
-body "$message`n`nSome more details if you like here…. `n`n -SmtpServer "valid-smtp-servername-here"
Well, that’s how easy it is!
Hope this helps,
Quote of the day:
To err is human, but to really foul things up requires a computer. - Farmers' Almanac