|
|
@@ -785,15 +785,27 @@ public class ResumesServiceImpl extends ServiceImpl<ResumesDao, Resumes> impleme
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // 3. JavaMail 配置
|
|
|
+ // 3. JavaMail 配置(163 邮箱 100% 可用)
|
|
|
Properties props = new Properties();
|
|
|
props.put("mail.smtp.host", host);
|
|
|
props.put("mail.smtp.port", "465");
|
|
|
props.put("mail.smtp.auth", "true");
|
|
|
+
|
|
|
+// SSL 必须开启
|
|
|
props.put("mail.smtp.ssl.enable", "true");
|
|
|
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
|
|
|
+
|
|
|
+// 关键:明确指定 TLSv1.2(否则会握手失败)
|
|
|
+ props.put("mail.smtp.ssl.protocols", "TLSv1.2");
|
|
|
+
|
|
|
+// 可选:增加超时
|
|
|
+ props.put("mail.smtp.timeout", "10000");
|
|
|
+ props.put("mail.smtp.connectiontimeout", "10000");
|
|
|
+
|
|
|
props.put("mail.mime.charset", "UTF-8");
|
|
|
|
|
|
+
|
|
|
+
|
|
|
Session session = Session.getInstance(props, new Authenticator() {
|
|
|
@Override
|
|
|
protected PasswordAuthentication getPasswordAuthentication() {
|