欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PowerShell小技巧之使用Hotmail賬號(hào)發(fā)送郵件

 更新時(shí)間:2014年09月15日 09:51:02   投稿:hebedich  
這篇文章主要介紹了PowerShell使用Hotmail賬號(hào)發(fā)送郵件的方法,以及遇到報(bào)錯(cuò)的時(shí)候的解決方法,希望對(duì)大家有所幫助

在低版本的PowerShell上發(fā)送郵件可以借助.NET的system.net.mail.smtpclient類。在高版本的PowerShell中可以借助現(xiàn)成的命令:Send-MailMessage

我在嘗試使用Hotmail時(shí),遇到了一個(gè)錯(cuò)誤:

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

后來(lái)發(fā)現(xiàn)是沒有指定端口號(hào),應(yīng)當(dāng)使用:587端口號(hào)。

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

常規(guī)錯(cuò)誤排查:

郵箱是否開啟SMTP服務(wù)
賬號(hào)和密碼是否輸入正確
端口號(hào)是否正確

相關(guān)文章

最新評(píng)論