gpt4 book ai didi

PowerShell小技巧之使用Hotmail账号发送邮件

转载 作者:qq735679552 更新时间:2022-09-29 22:32:09 25 4
gpt4 key购买 nike

CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界.

这篇CFSDN的博客文章PowerShell小技巧之使用Hotmail账号发送邮件由作者收集整理,如果你对这篇文章有兴趣,记得点赞哟.

在低版本的PowerShell上发送邮件可以借助.NET的system.net.mail.smtpclient类。在高版本的PowerShell中可以借助现成的命令:Send-MailMessage 。

我在尝试使用Hotmail时,遇到了一个错误:

?
1
2
Send-MailMessage : The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a
STARTTLS command first

后来发现是没有指定端口号,应当使用:587端口号.

?
1
Send-MailMessage -Body 'test' -SmtpServer smtp.live.com -From appana@outlook.com -To 'admin@pstips.net' -Subject 'test' -UseSsl -Credential i@outlook.com -Port 587

常规错误排查:

邮箱是否开启SMTP服务 账号和密码是否输入正确 端口号是否正确 。

最后此篇关于PowerShell小技巧之使用Hotmail账号发送邮件的文章就讲到这里了,如果你想了解更多关于PowerShell小技巧之使用Hotmail账号发送邮件的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com