Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的项目中,需要创建一个发送多封电子邮件的作业。我正在考虑使用 Spring 邮件 API。我检查了有一种方法
send(MimeMessage[] mimeMessages)
哪个将批量发送电子邮件,我有一个问题,如果任何邮件在发送时失败,是整个工作失败还是将发送其余邮件?是否有可能得到一个成功,哪个失败的结果?
看看https://github.com/SpringSource/spring-framework/blob/master/spring-context-support/src/main/java/org/springframework/mail/javamail/JavaMailSenderImpl.java。
消息是单独发送的,并且send(MimeMessage[])方法 throwsMailSendException包含未能发送的消息。
send(MimeMessage[])
MailSendException