smtp.office365.com 无法从传输连接中读取数据: net_io_connectionclosed
2022-02-13 18:04 taozsay 阅读(976) 评论(0) 收藏 举报这几天发送邮件时突然会报一个错
无法从传输连接中读取数据: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
            
            作者:taoz
            
            出处:www.cnblogs.com/bigbrid
            
            本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
            
            
            
                  本文如对您有帮助,还请多帮 【推荐】 下此文。
            如果喜欢我的文章,请关注我的公众号
        
                    
                
                
            
        
浙公网安备 33010602011771号