public final class MimeMessageUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static MimeMessage |
createMimeMessage(Session session,
byte[] source)
Create a MimeMessage.
|
static MimeMessage |
createMimeMessage(Session session,
java.io.File source)
Create a MimeMessage.
|
static MimeMessage |
createMimeMessage(Session session,
java.io.InputStream source)
Create a MimeMessage.
|
static MimeMessage |
createMimeMessage(Session session,
java.lang.String source)
Create a MimeMessage using the platform's default character encoding.
|
static void |
writeMimeMessage(MimeMessage mimeMessage,
java.io.File resultFile)
Convenience method to write a MimeMessage into a file.
|
public static MimeMessage createMimeMessage(Session session, byte[] source) throws MessagingException, java.io.IOException
session
- the mail sessionsource
- the input dataMessagingException
- creating the MimeMessage failedjava.io.IOException
- creating the MimeMessage failedpublic static MimeMessage createMimeMessage(Session session, java.io.File source) throws MessagingException, java.io.IOException
session
- the mail sessionsource
- the input dataMessagingException
- creating the MimeMessage failedjava.io.IOException
- creating the MimeMessage failedpublic static MimeMessage createMimeMessage(Session session, java.io.InputStream source) throws MessagingException
session
- the mail sessionsource
- the input dataMessagingException
- creating the MimeMessage failedpublic static MimeMessage createMimeMessage(Session session, java.lang.String source) throws MessagingException, java.io.IOException
session
- the mail sessionsource
- the input dataMessagingException
- creating the MimeMessage failedjava.io.IOException
- creating the MimeMessage failedpublic static void writeMimeMessage(MimeMessage mimeMessage, java.io.File resultFile) throws MessagingException, java.io.IOException
mimeMessage
- the MimeMessage to writeresultFile
- the file containing the MimeMessgaeMessagingException
- accessing MimeMessage failedjava.io.IOException
- writing the MimeMessage failed"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"