Interface 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.- Since:
- 07.10.2003
- Author:
- Juergen Hoeller
- See Also:
JavaMailSender.send(MimeMessagePreparator)
,JavaMailSender.send(MimeMessagePreparator[])
,MimeMessageHelper
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
prepare(MimeMessage mimeMessage)
Prepare the given new MimeMessage instance.
Method Detail
prepare
void prepare(MimeMessage mimeMessage) throws Exception
Prepare the given new MimeMessage instance.- Parameters:
mimeMessage
- the message to prepare- Throws:
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