发送邮件错误捕获处理

This commit is contained in:
wanjia 2022-08-12 14:04:32 +08:00
parent 4e11f623b0
commit 4210e4843b
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ public class EmailService {
flag = true; flag = true;
unSentEmailSendRecord.setSentAt(new Date()); unSentEmailSendRecord.setSentAt(new Date());
unSentEmailSendRecord.setStatus(flag ? NotificationSystemConstant.EMAIL_SENT_SUCCESS : NotificationSystemConstant.EMAIL_SENT_FAIL); unSentEmailSendRecord.setStatus(flag ? NotificationSystemConstant.EMAIL_SENT_SUCCESS : NotificationSystemConstant.EMAIL_SENT_FAIL);
} catch (MessagingException e) { } catch (Exception e) {
logger.error("发送邮件失败email: " + unSentEmailSendRecord.getEmail() + "\n" + e); logger.error("发送邮件失败email: " + unSentEmailSendRecord.getEmail() + "\n" + e);
} }
} }