| | |
| | | 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; |
| | |
| | | * @author xuyuxiang |
| | | * @date 2020/6/9 22:54 |
| | | */ |
| | | @Slf4j |
| | | public class SimpleMailSender implements MailSender { |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @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("邮件发送完成.."); |
| | | |
| | | } |
| | | |
| | | /** |