[修改]发送邮件

This commit is contained in:
sunzheng
2024-01-15 17:57:23 +08:00
parent 5e451afc66
commit 56bea7bbaa
2 changed files with 13 additions and 12 deletions
@@ -121,18 +121,18 @@ public class SendMessageServiceImpl implements SendMessageService {
}
email = PasswordUtil.decrypt(email);
emailPassword = PasswordUtil.decrypt(emailPassword);
//EmailSendMsgHandle emailHandle = new EmailSendMsgHandle(email,emailPassword);
//// 发送带附件邮箱
// if(!CollectionUtils.isEmpty(sendMessageDTO.getListFile())){
// emailHandle.SendMsgAndFile(sendMessageDTO.getEmail(), title, content,sendMessageDTO.getListFile());
// }else{
// //如果有通知内容就替换
// if (StringUtils.isNotBlank(sendMessageDTO.getMeetingNotice())){
// emailHandle.SendMsg(sendMessageDTO.getEmail(), title, sendMessageDTO.getMeetingNotice());
// }else {
// emailHandle.SendMsg(sendMessageDTO.getEmail(), title, content);
// }
// }
EmailSendMsgHandle emailHandle = new EmailSendMsgHandle(email,emailPassword);
// 发送带附件邮箱emailPassword = "wflwijcpdmwvcihc"
if(!CollectionUtils.isEmpty(sendMessageDTO.getListFile())){
emailHandle.SendMsgAndFile(sendMessageDTO.getEmail(), title, content,sendMessageDTO.getListFile());
}else{
//如果有通知内容就替换
if (StringUtils.isNotBlank(sendMessageDTO.getMeetingNotice())){
emailHandle.SendMsg(sendMessageDTO.getEmail(), title, sendMessageDTO.getMeetingNotice());
}else {
emailHandle.SendMsg(sendMessageDTO.getEmail(), title, content);
}
}
}catch (Exception e){
log.error("发送邮件异常",e);
if (e.getMessage() !=null){
@@ -25,6 +25,7 @@ spring:
max-file-size: 50MB
max-request-size: 50MB
mail:
# host: smtp.qq.com
host: smtp.126.com
# host: smtp.qiye.163.com
username: zhangqinlin@syxysoft.com