Commit b64a39c8 authored by Quxl's avatar Quxl

x

parent bf1c38a3
......@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.egolm.common.MailUtil;
import com.egolm.common.StringUtil;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.film.api.service.EmailService;
import com.egolm.film.bean.Fc_email_record;
......@@ -20,8 +21,7 @@ public class EmailServiceImpl implements EmailService {
@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;
@Value("${spring.profiles.active}") private String profiles;
@Value("${com.egolm.film.email.test}") private String testEmail;
@Autowired
JdbcTemplate jdbcTemplate;
......@@ -40,7 +40,7 @@ public class EmailServiceImpl implements EmailService {
new Thread() {
public void run() {
try {
MailUtil.sendBySmtp(host, port, is_auth, username, password, from, subject, content, null, !profiles.equals("pro") ? "sun.nana@egolm.com" : email);
MailUtil.sendBySmtp(host, port, is_auth, username, password, from, subject, content, null, StringUtil.isNotBlank(testEmail) ? testEmail : email);
record.setSend_state(1);
} catch (Exception e) {
record.setSend_state(2);
......
......@@ -9,6 +9,8 @@ spring.http.multipart.maxRequestSize=5MB
spring.http.encoding.force=true
spring.http.encoding.enabled=true
spring.http.encoding.charset=utf-8
com.egolm.film.email.test=sun.nana@egolm.com
com.egolm.film.email.smtp.host=smtp.siff.com
com.egolm.film.email.smtp.port=25
com.egolm.film.email.smtp.is_auth=true
......
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