diff --git a/src/main/java/com/rymcu/vertical/service/impl/JavaMailServiceImpl.java b/src/main/java/com/rymcu/vertical/service/impl/JavaMailServiceImpl.java index c930885..7c3bc57 100644 --- a/src/main/java/com/rymcu/vertical/service/impl/JavaMailServiceImpl.java +++ b/src/main/java/com/rymcu/vertical/service/impl/JavaMailServiceImpl.java @@ -63,7 +63,8 @@ public class JavaMailServiceImpl implements JavaMailService { private Integer sendCode(String to, Integer type) throws MessagingException { Properties props = new Properties(); // 表示SMTP发送邮件,需要进行身份验证 - props.put("mail.smtp.auth", "true"); + props.put("mail.smtp.auth", true); + props.put("mail.smtp.ssl.enable", true); props.put("mail.smtp.host", SERVER_HOST); props.put("mail.smtp.port", SERVER_PORT); // 如果使用ssl,则去掉使用25端口的配置,进行如下配置,