$From = "admin@leoguides.me"
$To = "anhtn@leoguides.me"
$Subject = "Photos of Drogon"
$Body = "Please see attached picture for reference."
$SMTPServer = "mail.leoguides.me"
$SMTPPort = "25"
Send-MailMessage -From $From -to $To -Subject $Subject -Body $Body -SmtpServer $SMTPServer -Port $SMTPPort
Send an email from an authenticated sesion
$From = "admin@leoguides.me"
$To = "anhtn@leoguides.me"
$Subject = "Photos of Drogon"
$Body = "Please see attached picture for reference."
$SMTPServer = "mail.leoguides.me"
$SMTPPort = "25"
Send-MailMessage -Credential (Get-Credential) -From $From -to $To -Subject $Subject -Body $Body -SmtpServer $SMTPServer -Port $SMTPPort
5/5 - (1 vote)