繁体   English   中英

使用 Powershell 通过 Gmail 发送 SMTP 邮件

[英]Sending SMTP Mail Through Gmail Using Powershell

我曾经有过这个工作,但不久前它停止了。 该帐户的密码有效,并且我的脚本中的注释已更改。

Send-MailMessage -From ESI-NIKE@gisx.com -Subject "Server ESI-NIKE Has Rebooted" -To Glen.krinsky@xerox.com -Attachments C:\1\Reboot\Previous5.txt -Body "ESI-NIKE has rebooted.  Please check the Event Log if this reboot is unexpected" -SmtpServer smtp.gmail.com -Port 587 -usessl -Credential (New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "zz.gms.service@gmail.com",(Get-Content -Path zz.gms.service@gmail.com.securestring | ConvertTo-SecureString))

也不要再为我工作了。 多年来,我一直使用 PowerShell 脚本通过 Gmail 发送电子邮件,而不是 Google G Suite,它最近刚刚停止工作。 错误是,SMTP需要安全连接,但是我已经在用587端口了,改成465端口了,还是不行

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM