public final class MimeMessageUtils extends Object
Modifier and Type | Method and Description |
---|---|
static javax.mail.internet.MimeMessage |
createMimeMessage(javax.mail.Session session,
byte[] source)
Create a MimeMessage.
|
static javax.mail.internet.MimeMessage |
createMimeMessage(javax.mail.Session session,
File source)
Create a MimeMessage.
|
static javax.mail.internet.MimeMessage |
createMimeMessage(javax.mail.Session session,
InputStream source)
Create a MimeMessage.
|
static javax.mail.internet.MimeMessage |
createMimeMessage(javax.mail.Session session,
String source)
Create a MimeMessage using the platform's default character encoding.
|
static void |
writeMimeMessage(javax.mail.internet.MimeMessage mimeMessage,
File resultFile)
Convenience method to write a MimeMessage into a file.
|
public static javax.mail.internet.MimeMessage createMimeMessage(javax.mail.Session session, byte[] source) throws javax.mail.MessagingException, IOException
session
- the mail sessionsource
- the input datajavax.mail.MessagingException
- creating the MimeMessage failedIOException
- creating the MimeMessage failedpublic static javax.mail.internet.MimeMessage createMimeMessage(javax.mail.Session session, File source) throws javax.mail.MessagingException, IOException
session
- the mail sessionsource
- the input datajavax.mail.MessagingException
- creating the MimeMessage failedIOException
- creating the MimeMessage failedpublic static javax.mail.internet.MimeMessage createMimeMessage(javax.mail.Session session, InputStream source) throws javax.mail.MessagingException
session
- the mail sessionsource
- the input datajavax.mail.MessagingException
- creating the MimeMessage failedpublic static javax.mail.internet.MimeMessage createMimeMessage(javax.mail.Session session, String source) throws javax.mail.MessagingException, IOException
session
- the mail sessionsource
- the input datajavax.mail.MessagingException
- creating the MimeMessage failedIOException
- creating the MimeMessage failedpublic static void writeMimeMessage(javax.mail.internet.MimeMessage mimeMessage, File resultFile) throws javax.mail.MessagingException, IOException
mimeMessage
- the MimeMessage to writeresultFile
- the file containing the MimeMessgaejavax.mail.MessagingException
- accessing MimeMessage failedIOException
- writing the MimeMessage failedCopyright © 2001–2018 The Apache Software Foundation. All rights reserved.