接口 MimeMessagePreparator
public interface MimeMessagePreparator
Callback interface for the preparation of JavaMail MIME messages.The corresponding
send
methods ofJavaMailSender
will take care of the actual creation of aMimeMessage
instance, and of proper exception conversion.It is often convenient to use a
MimeMessageHelper
for populating the passed-in MimeMessage, in particular when working with attachments or special character encodings. SeeMimeMessageHelper's javadoc
for an example.- 从以下版本开始:
- 07.10.2003
- 作者:
- Juergen Hoeller
- 另请参阅:
JavaMailSender.send(MimeMessagePreparator)
,JavaMailSender.send(MimeMessagePreparator[])
,MimeMessageHelper
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 void
prepare(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