smtp.office365.com 无法从传输连接中读取数据: net_io_connectionclosed


这几天发送邮件时突然会报一个错

无法从传输连接中读取数据:net_io_connectionclosed。

因使用的是 smtp.office365.com

经过查询,发现了这个

Recently, we started rejecting a percentage of connections to smtp.office365.com that uses TLS1.0/1.1 
for SMTP AUTH (complete disablement will start early 2022).

所以切换到TLS1.2就能够修复。

附上代码:

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | 
            SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

 

 

 

参考:https://stackoverflow.com/questions/28362132/office-365-smtp-starts-firing-net-io-connectionclosed

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM