From 218b4a06a7fd97d2b0046ee43177397fe4cb62fe Mon Sep 17 00:00:00 2001 From: ronger Date: Fri, 27 Mar 2020 16:15:58 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E9=82=AE=E4=BB=B6=E5=8F=91=E9=80=81?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/rymcu/vertical/service/impl/JavaMailServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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端口的配置,进行如下配置,