Commit 5bf5de55 authored by Quxl's avatar Quxl

优化邮件发送

parent 57062a76
......@@ -13,13 +13,14 @@ public class EmailServiceImpl implements EmailService {
@Value("${com.egolm.film.email.smtp.port}") private Integer port;
@Value("${com.egolm.film.email.smtp.is_auth}") private Boolean is_auth;
@Value("${com.egolm.film.email.smtp.from}") private String from;
@Value("${com.egolm.film.email.smtp.username}") private String username;
@Value("${com.egolm.film.email.smtp.password}") private String password;
@Override
public void send(String subject, String content, String... emailAddress) {
new Thread() {
public void run() {
MailUtil.sendBySmtp(host, port, is_auth, from, password, subject, content, null, emailAddress);
MailUtil.sendBySmtp(host, port, is_auth, username, password, from, subject, content, null, emailAddress);
}
}.start();
}
......
......@@ -111,10 +111,11 @@ public class MemberOpenApiController {
Boolean is_auth = true;
String content = "测试邮件";
String from = "qu.xinliang@egolm.com";
String username = "qu.xinliang";
String password = "Liang12345";
String to = "747539993@qq.com";
String subject = "测试邮件";
MailUtil.sendBySmtp(host, port, is_auth, from, password, subject, content, null, to);
MailUtil.sendBySmtp(host, port, is_auth, username, password, from, subject, content, null, to);
}
@ResponseBody
......
......@@ -17,4 +17,5 @@ com.egolm.film.email.smtp.host=mail.egolm.com
com.egolm.film.email.smtp.port=25
com.egolm.film.email.smtp.is_auth=true
com.egolm.film.email.smtp.from=qu.xinliang@egolm.com
com.egolm.film.email.smtp.username=qu.xinliang
com.egolm.film.email.smtp.password=Liang12345
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment