使用Powershell发邮件
$EmailFrom = “from.email@dummy.com”
$EmailTo = “to.email@dummy.com”
$Subject = “Hello”
$Body = “Hello World”
$SMTPServer = “smtp.server.host”
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential(“username”, “password”);
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)