Showing posts with label powershell. Show all posts
Showing posts with label powershell. Show all posts

Wednesday, June 25, 2014

Windows out of the box cmd send mail one liner with variables in subject/body

powershell -Command "Send-MailMessage -To to@recepient.com -Cc cc@recepient.com -From from@sender.com -SmtpServer 127.0.0.1 -Subject $('Mail from computer: ' + (hostname)) -Body $((date).ToString() + ' Mail from computer: ' + (hostname))