Java mail outlook发邮件提示升级TLS1.2
发送邮件失败提示如下:javax.mail.AuthenticationFailedException: 421 4.7.66 TLS 1.0 and 1.1 are not supported.Please upgrade/update your client to support TLS 1.2.Visit https://aka.ms/smtp_auth_tls. [HK0PR03CA009
·
发送邮件失败提示如下:
javax.mail.AuthenticationFailedException: 421 4.7.66 TLS 1.0 and 1.1 are not supported.
Please upgrade/update your client to support TLS 1.2.
Visit https://aka.ms/smtp_auth_tls. [HK0PR03CA0098.apcprd03.prod.outlook.com]
增加发送邮件参数pro.put(“mail.smtp.ssl.protocols”, “TLSv1.2”);
pro.put("mail.smtp.host", "smtp.outlook.office365.com");
pro.put("mail.smtp.port", "587");
pro.put("mail.smtp.auth", "true");
pro.put("mail.smtp.starttls.enable", true);
pro.put("mail.smtp.connectiontimeout", "36000");//连接服务器过期时间
pro.put("mail.smtp.timeout", "36000");
pro.put("mail.smtp.ssl.protocols", "TLSv1.2");//设置使用TLS1.2版本
首先的确保邮件服务器能够支持TLS1.2
更多推荐
已为社区贡献1条内容
所有评论(0)