update 回滚邮件发送通用功能
This commit is contained in:
+22
-23
@@ -110,29 +110,28 @@ public class SendMessageServiceImpl implements SendMessageService {
|
|||||||
throw new JeroBootException("邮件发送,邮箱地址不能为空!");
|
throw new JeroBootException("邮件发送,邮箱地址不能为空!");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
throw new JeroBootException("邮件发送失败,发件人的邮箱或邮箱授权码错误!");
|
String email = loginUser.getEmail();
|
||||||
//String email = loginUser.getEmail();
|
String emailPassword = loginUser.getEmailPassword();
|
||||||
//String emailPassword = loginUser.getEmailPassword();
|
//如果发件人没有邮箱或邮箱授权码则使用admin账户的邮箱授权码
|
||||||
////如果发件人没有邮箱或邮箱授权码则使用admin账户的邮箱授权码
|
if (StringUtils.isBlank(email) || StringUtils.isBlank(emailPassword)) {
|
||||||
//if (StringUtils.isBlank(email) || StringUtils.isBlank(emailPassword)) {
|
loginUser = sysBaseAPI.getUserByName(env.getProperty("message.systemEmailUser"));
|
||||||
// loginUser = sysBaseAPI.getUserByName(env.getProperty("message.systemEmailUser"));
|
email = loginUser.getEmail();
|
||||||
// email = loginUser.getEmail();
|
emailPassword = loginUser.getEmailPassword();
|
||||||
// emailPassword = loginUser.getEmailPassword();
|
}
|
||||||
//}
|
email = PasswordUtil.decrypt(email);
|
||||||
//email = PasswordUtil.decrypt(email);
|
emailPassword = PasswordUtil.decrypt(emailPassword);
|
||||||
//emailPassword = PasswordUtil.decrypt(emailPassword);
|
EmailSendMsgHandle emailHandle = new EmailSendMsgHandle(email,emailPassword);
|
||||||
//EmailSendMsgHandle emailHandle = new EmailSendMsgHandle(email,emailPassword);
|
// 发送带附件邮箱
|
||||||
//// 发送带附件邮箱
|
if(!CollectionUtils.isEmpty(sendMessageDTO.getListFile())){
|
||||||
//if(!CollectionUtils.isEmpty(sendMessageDTO.getListFile())){
|
emailHandle.SendMsgAndFile(sendMessageDTO.getEmail(), title, content,sendMessageDTO.getListFile());
|
||||||
// emailHandle.SendMsgAndFile(sendMessageDTO.getEmail(), title, content,sendMessageDTO.getListFile());
|
}else{
|
||||||
//}else{
|
//如果有通知内容就替换
|
||||||
// //如果有通知内容就替换
|
if (StringUtils.isNotBlank(sendMessageDTO.getMeetingNotice())){
|
||||||
// if (StringUtils.isNotBlank(sendMessageDTO.getMeetingNotice())){
|
emailHandle.SendMsg(sendMessageDTO.getEmail(), title, sendMessageDTO.getMeetingNotice());
|
||||||
// emailHandle.SendMsg(sendMessageDTO.getEmail(), title, sendMessageDTO.getMeetingNotice());
|
}else {
|
||||||
// }else {
|
emailHandle.SendMsg(sendMessageDTO.getEmail(), title, content);
|
||||||
// emailHandle.SendMsg(sendMessageDTO.getEmail(), title, content);
|
}
|
||||||
// }
|
}
|
||||||
//}
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error("发送邮件异常",e);
|
log.error("发送邮件异常",e);
|
||||||
if (e.getMessage() !=null){
|
if (e.getMessage() !=null){
|
||||||
|
|||||||
Reference in New Issue
Block a user