public final class MimeMessageHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static javax.mail.internet.MimeMessage |
produceMimeMessage(Email email,
javax.mail.Session session)
Creates a new
MimeMessage instance coupled to a specific Session instance and prepares it in the email structure, so that it
can be filled and send. |
static javax.mail.internet.MimeMessage |
signMessageWithDKIM(javax.mail.internet.MimeMessage message,
Email email)
Primes the
MimeMessage instance for signing with DKIM. |
public static javax.mail.internet.MimeMessage produceMimeMessage(Email email, javax.mail.Session session) throws javax.mail.MessagingException, UnsupportedEncodingException
MimeMessage instance coupled to a specific Session instance and prepares it in the email structure, so that it
can be filled and send.
Fills subject, from,reply-to, content, sent-date, recipients, texts, embedded images, attachments, content and adds all headers.email - The email message from which the subject and From-address are extracted.session - The Session to attach the MimeMessage toMessage instance, ready to be sent.javax.mail.MessagingException - May be thrown when the message couldn't be processed by JavaMail.UnsupportedEncodingException - Zie InternetAddress.InternetAddress(String, String).setRecipients(Email, Message),
setTexts(Email, MimeMultipart),
setEmbeddedImages(Email, MimeMultipart),
setAttachments(Email, MimeMultipart)public static javax.mail.internet.MimeMessage signMessageWithDKIM(javax.mail.internet.MimeMessage message,
Email email)
MimeMessage instance for signing with DKIM. The signing itself is performed by DkimMessage and DkimSigner
during the physical sending of the message.message - The message to be signed when sent.email - The Email that contains the relevant signing informationCopyright © 2017. All rights reserved.