|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Extended MailSender interface for JavaMail, supporting MIME messages both as direct arguments and via preparation callbacks.
Not as easy to test as a plain MailSender, but still rather easy compared to full JavaMail code: Just let createMimeMessage return a plain MimeMessage created with a Session.getInstance (empty properties) call, and check the given messages in your mock implementations of the various send methods.
The recommended way of using this class is the MimeMessagePreparator mechanism, possibly using a MimeMessageHelper for populating the message. See MimeMessageHelper's javadoc for an example.
JavaMailSenderImpl
,
MimeMessagePreparator
,
MimeMessageHelper
Method Summary | |
javax.mail.internet.MimeMessage |
createMimeMessage()
Create a new JavaMail MimeMessage for the underlying JavaMail Session of this sender. |
void |
send(javax.mail.internet.MimeMessage mimeMessage)
Send the given JavaMail MIME message. |
void |
send(javax.mail.internet.MimeMessage[] mimeMessages)
Send the given array of JavaMail MIME messages in batch. |
void |
send(MimeMessagePreparator mimeMessagePreparator)
Send the JavaMail MIME message prepared by the given MimeMessagePreparator. |
void |
send(MimeMessagePreparator[] mimeMessagePreparators)
Send the JavaMail MIME messages prepared by the given MimeMessagePreparators. |
Methods inherited from interface org.springframework.mail.MailSender |
send, send |
Method Detail |
public javax.mail.internet.MimeMessage createMimeMessage()
send(MimeMessage)
,
send(MimeMessage[])
public void send(javax.mail.internet.MimeMessage mimeMessage) throws MailException
mimeMessage
- message to send
MailException
- in case of message, authentication or send errorscreateMimeMessage()
public void send(javax.mail.internet.MimeMessage[] mimeMessages) throws MailException
mimeMessages
- messages to send
MailException
- in case of message, authentication or send errorscreateMimeMessage()
public void send(MimeMessagePreparator mimeMessagePreparator) throws MailException
mimeMessagePreparator
- the preparator to use
MailException
- in case of message, authentication or send errorspublic void send(MimeMessagePreparator[] mimeMessagePreparators) throws MailException
mimeMessagePreparators
- the preparator to use
MailException
- in case of message, authentication or send errors
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |