Commit 9938b6ea authored by Quxl's avatar Quxl

x

parent c64e629f
......@@ -6,6 +6,7 @@ import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.dao.EmptyResultDataAccessException;
......@@ -27,6 +28,8 @@ import com.egolm.film.util.Common;
@Service
public class EmailServiceImpl implements EmailService {
private static final Logger logger = Logger.getLogger(EmailService.class);
@Value("${com.egolm.film.email.smtp.host}") private String host;
@Value("${com.egolm.film.email.smtp.port}") private Integer port;
@Value("${com.egolm.film.email.smtp.from}") private String from;
......@@ -54,6 +57,7 @@ public class EmailServiceImpl implements EmailService {
MailUtil.sendBySmtps(host, port, username, password, from, subject, content, null, StringUtil.isNotBlank(testEmail) ? testEmail : email);
record.setSend_state(1);
} catch (Exception e) {
logger.error("邮件发送失败", e);
record.setSend_state(2);
} finally {
jdbcTemplate.update(record);
......
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