Merge pull request #360 from caryyu/master

Solve this: https://github.com/xuxueli/xxl-job/issues/359
master
许雪里 7 years ago committed by GitHub
commit efe0ed918d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java
  2. 8
      xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/MailUtil.java
  3. 1
      xxl-job-admin/src/main/resources/xxl-job-admin.properties

@ -27,6 +27,9 @@ public class XxlJobAdminConfig implements InitializingBean{
@Value("${xxl.job.mail.port}")
private String mailPort;
@Value("${xxl.job.mail.ssl}")
private boolean mailSSL;
@Value("${xxl.job.mail.username}")
private String mailUsername;
@ -54,6 +57,10 @@ public class XxlJobAdminConfig implements InitializingBean{
return mailPort;
}
public boolean isMailSSL() {
return mailSSL;
}
public String getMailUsername() {
return mailUsername;
}

@ -35,8 +35,14 @@ public class MailUtil {
//email.setSSL(true);
email.setHostName(XxlJobAdminConfig.getAdminConfig().getMailHost());
if (XxlJobAdminConfig.getAdminConfig().isMailSSL()) {
email.setSslSmtpPort(XxlJobAdminConfig.getAdminConfig().getMailPort());
email.setSSLOnConnect(true);
} else {
email.setSmtpPort(Integer.valueOf(XxlJobAdminConfig.getAdminConfig().getMailPort()));
//email.setSslSmtpPort(port);
}
email.setAuthenticator(new DefaultAuthenticator(XxlJobAdminConfig.getAdminConfig().getMailUsername(), XxlJobAdminConfig.getAdminConfig().getMailPassword()));
email.setCharset(Charset.defaultCharset().name());

@ -7,6 +7,7 @@ xxl.job.db.password=root_pwd
### xxl-job email
xxl.job.mail.host=smtp.163.com
xxl.job.mail.port=25
xxl.job.mail.ssl=false
xxl.job.mail.username=ovono802302@163.com
xxl.job.mail.password=asdfzxcv
xxl.job.mail.sendNick=《任务调度平台XXL-JOB》

Loading…
Cancel
Save