Send-MailMessage -From "user@domain.com" -To "user@domain.com" -Subject "subject" -Body "Message" -SmtpServer servername.local
or by using splatting:
$body = "body message"
$email = @{
From = "user@domain.com"
To = "user@domain.com"
Subject = "subject"
SMTPServer = "servername.local"
Body = $body
}
Send-MailMessage @email
Noroc
ReplyDeleteTo send to multiple recipients use this:
-To User2 ", "User3 "