From 7fe1bd7734e8a1f80523d5fce34290e3f20a7403 Mon Sep 17 00:00:00 2001 From: inleft <inleft@qq.com> Date: Sun, 21 Aug 2022 21:09:23 +0800 Subject: [PATCH] 新增邮件消息自提醒 --- snowy-base/snowy-core/src/main/java/vip/xiaonuo/core/email/modular/SimpleMailSender.java | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/snowy-base/snowy-core/src/main/java/vip/xiaonuo/core/email/modular/SimpleMailSender.java b/snowy-base/snowy-core/src/main/java/vip/xiaonuo/core/email/modular/SimpleMailSender.java index 109f798..715b9ce 100644 --- a/snowy-base/snowy-core/src/main/java/vip/xiaonuo/core/email/modular/SimpleMailSender.java +++ b/snowy-base/snowy-core/src/main/java/vip/xiaonuo/core/email/modular/SimpleMailSender.java @@ -28,6 +28,8 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.extra.mail.MailAccount; import cn.hutool.extra.mail.MailUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.annotation.Async; import vip.xiaonuo.core.email.MailSender; import vip.xiaonuo.core.email.modular.exception.MailSendException; import vip.xiaonuo.core.email.modular.model.SendMailParam; @@ -38,6 +40,7 @@ * @author xuyuxiang * @date 2020/6/9 22:54 */ +@Slf4j public class SimpleMailSender implements MailSender { /** @@ -60,13 +63,16 @@ } @Override + @Async public void sendMailHtml(SendMailParam sendMailParam) { - + log.info("邮件发送.."); //校验发送邮件的参数 assertSendMailParams(sendMailParam); //spring发送邮件 MailUtil.send(mailAccount, CollUtil.newArrayList(sendMailParam.getTo()), sendMailParam.getTitle(), sendMailParam.getContent(), true); + log.info("邮件发送完成.."); + } /** -- Gitblit v1.9.1