Sending email from PowerShell
I recently had a work task that needed to read through a text file and then email a user if certain conditions were meet.
From PowerShell 2.0 and up it’s a pretty simple process using Send-MailMessage:
Send-MailMessage -To firstname.lastname@example.org -From "email@example.com" -SmtpServer mail.domin.com -Subject "Important notice" -body (Get-Service | Format-Table)
In PowerShell 1.0 we don’t have the luxury and you need to do something like the link below.