mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 02:46:50 +08:00
[DAT] 发邮件增加日志打印
This commit is contained in:
@@ -11,12 +11,14 @@ import javax.mail.Transport;
|
|||||||
import javax.mail.internet.InternetAddress;
|
import javax.mail.internet.InternetAddress;
|
||||||
import javax.mail.internet.MimeMessage;
|
import javax.mail.internet.MimeMessage;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.xboe.module.assistance.service.ISmtpEmailService;
|
import com.xboe.module.assistance.service.ISmtpEmailService;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class SmtpEmailServiceImpl implements ISmtpEmailService {
|
public class SmtpEmailServiceImpl implements ISmtpEmailService {
|
||||||
|
|
||||||
// SMTP服务器配置信息
|
// SMTP服务器配置信息
|
||||||
@@ -80,6 +82,7 @@ public class SmtpEmailServiceImpl implements ISmtpEmailService {
|
|||||||
message.setContent(htmlMsg, "text/html;charset=UTF-8");
|
message.setContent(htmlMsg, "text/html;charset=UTF-8");
|
||||||
|
|
||||||
// 发送邮件
|
// 发送邮件
|
||||||
|
log.info("发送邮件. 发件人: {}, 收件人: {}, 标题: {}", fromAddress, to, subject);
|
||||||
Transport.send(message);
|
Transport.send(message);
|
||||||
|
|
||||||
} catch (MessagingException e) {
|
} catch (MessagingException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user