Sending urgent messages from powershell

#Setup & Send our Mail

$SmtpClient = new-object Net.Mail.SmtpClient("smtp.host.com")

#Message formatting

$MailMessage = New-Object system.net.mail.MailMessage

$MailMessage.From = "The Farm Hand <chicken_counter@professionalvmware.com>"        

$MailMessage.To.add("john@fromthebrink.org")

$MailMessage.Subject = "Direct from your local VC: Weekly Statistics"

$MailMessage.Priority = "high" 

 

#Build Body

$Body += "line one"

$Body += "line two”

$Body += "line three”

 

$MailMessage.Body = $Body

 

#Send message 

$SmtpClient.Send($MailMessage)

Leave a Reply

Your email address will not be published. Required fields are marked *