接口 MimeMessagePreparator
public interface MimeMessagePreparator
Callback interface for the preparation of JavaMail MIME messages.The corresponding
sendmethods ofJavaMailSenderwill take care of the actual creation of aMimeMessageinstance, and of proper exception conversion.It is often convenient to use a
MimeMessageHelperfor populating the passed-in MimeMessage, in particular when working with attachments or special character encodings. SeeMimeMessageHelper's javadocfor an example.- 从以下版本开始:
- 07.10.2003
- 作者:
- Juergen Hoeller
- 另请参阅:
JavaMailSender.send(MimeMessagePreparator),JavaMailSender.send(MimeMessagePreparator[]),MimeMessageHelper
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 voidprepare(MimeMessage mimeMessage)Prepare the given new MimeMessage instance.
方法详细资料
prepare
void prepare(MimeMessage mimeMessage) throws Exception
Prepare the given new MimeMessage instance.- 参数:
mimeMessage- the message to prepare- 抛出:
MessagingException- passing any exceptions thrown by MimeMessage methods through for automatic conversion to the MailException hierarchyIOException- passing any exceptions thrown by MimeMessage methods through for automatic conversion to the MailException hierarchyException- if mail preparation failed, for example when a Velocity template cannot be rendered for the mail text