我想通過使用powershell腳本的Gmail郵件服務器發送電子郵件。但我不能夠發送電子郵件..我用下面的腳本 -使用powershell發送電子郵件與gmail
$EmailFrom = "[email protected]"
$EmailTo = "[email protected]"
$Subject = "Notification from XYZ"
$Body = "this is a notification from XYZ Notifications.."
$SMTPServer = "smtp.gmail.com"
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential("bttpm", "Password");
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)
你檢查了連接嗎? – 2015-03-13 10:08:14
是的,我可以telnet端口 – 2015-03-13 10:15:34