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