My subject is probably not worded correctly.
I am working on some scripts and using the "Send-MailMessage" command. I need to have some variables in the body of the message…. How can I do this? These variables are directories, log file locations, IP addresses, etc from the script. When the script finishes or fails I need to send an email with pertinent info about the job..
$bod = @"
Send-MailMessage -To firstname.lastname@example.org -Subject subject -From email@example.com -body $bod -SmtpServer server