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