Commit 9043ddf2 authored by Quxl's avatar Quxl

修改邮件发送

parent f2578808
......@@ -63,6 +63,14 @@
<artifactId>activation</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>javax.mail-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
......
......@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.MailUtil;
import com.egolm.common.bean.Rjx;
import com.egolm.common.web.ServletUtil;
import com.egolm.film.api.member.service.MemberService;
......@@ -81,6 +82,25 @@ public class MemberOpenApiController {
return Rjx.jsonOk();
}
public static void main(String[] args) {
/**
* 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.password=Liang12345
*/
String host = "mail.egolm.com";
Integer port = 25;
Boolean is_auth = true;
String content = "测试邮件";
String from = "qu.xinliang@egolm.com";
String password = "Liang12345";
String to = "747539993@qq.com";
String subject = "测试邮件";
MailUtil.sendBySmtp(host, port, is_auth, from, password, subject, content, null, to);
}
@ResponseBody
@PostMapping("setLocale")
@ApiOperation("设置语言环境")
......
......@@ -17,7 +17,7 @@ public class EmailServiceImpl implements EmailService {
@Override
public void send(String subject, String content, String... emailAddress) {
MailUtil.sendBySmtp(host, port, is_auth, content, password, subject, content, null, emailAddress);
MailUtil.sendBySmtp(host, port, is_auth, from, password, subject, content, null, emailAddress);
}
}
......@@ -17,7 +17,7 @@ spring.messages.basename=classpath:i18n/messages
spring.messages.cache-seconds=3600
spring.messages.encoding=UTF-8
com.egolm.film.email.smtp.host=smtp.163.com
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=15601712556@163.com
......
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