JavaMail兼容outlook異常550 5.7.67 TLS 1.0 and 1.1


1.簡述

  出現javax.mail.AuthenticationFailedException: 550 5.7.67 TLS 1.0 and 1.1 are not supported by your organization. Please contact your administrator. [SG2PR0302CA0011.apcprd03.prod.outlook.com]異常的原因是,使用的outlook賬號或者其他郵箱賬號不支持TLX1.0、1.1協議。

2.解決方案

  在郵箱配置中指定使用的TLX協議,實例如下:

Properties p = new Properties();
p.put("mail.smtp.port", "587");
p.put("mail.smtp.host", "smtp.office365.com");
p.put("mail.smtp.auth", "true");//當前smtp host設為可信任
p.put("mail.smtp.starttls.enable", "true"); // 設置是否使用tsl安全連接
p.put("mail.smtp.ssl.protocols", "TLSv1.2");//不支持Tls1.0、1.1
View Code

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM