Commit 9043ddf2 authored by Quxl's avatar Quxl

修改邮件发送

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