public class ExtendedMimeMessage
extends javax.mail.internet.MimeMessage
MimeMessage
in order to support processing by this mail API.Constructor and Description |
---|
ExtendedMimeMessage()
Create a new extended MimeMessage.
|
ExtendedMimeMessage(javax.mail.internet.MimeMessage source) |
ExtendedMimeMessage(javax.mail.Session session,
InputStream is)
Constructs a MimeMessage by reading and parsing the data from the specified MIME InputStream.
|
Modifier and Type | Method and Description |
---|---|
boolean |
ensureSaved()
Ensure that a message is saved to ensure the stability of its Message-ID header.
|
String |
getType()
Retrieve what type of email is being sent (see
setType(String) ). |
String |
getUniqueMessageId()
Compute a unique message identifier for this mime message.
|
boolean |
isEmpty() |
void |
setHeader(String name,
String value) |
void |
setMessageId(String messageId)
Save the message and set the message-ID headers of the message to the provided value.
|
void |
setType(String mailType)
Specifies what type of email is being sent.
|
static ExtendedMimeMessage |
wrap(javax.mail.internet.MimeMessage message)
Helper method to wrap any
MimeMessage into an ExtendedMimeMessage , without double wrapping. |
addFrom, addHeader, addHeaderLine, addRecipients, addRecipients, createInternetHeaders, createMimeMessage, getAllHeaderLines, getAllHeaders, getAllRecipients, getContent, getContentID, getContentLanguage, getContentMD5, getContentStream, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getFlags, getFrom, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getMessageID, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getReceivedDate, getRecipients, getReplyTo, getSender, getSentDate, getSize, getSubject, isMimeType, isSet, parse, removeHeader, reply, reply, saveChanges, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFlags, setFrom, setFrom, setFrom, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setSubject, setText, setText, setText, updateHeaders, updateMessageID, writeTo, writeTo
public ExtendedMimeMessage()
public ExtendedMimeMessage(javax.mail.Session session, InputStream is) throws javax.mail.MessagingException
session
- Session object for this messageis
- the message input streamjavax.mail.MessagingException
- on errorpublic ExtendedMimeMessage(javax.mail.internet.MimeMessage source) throws javax.mail.MessagingException
source
- see javadoc for MimeMessage(javax.mail.internet.MimeMessage)
javax.mail.MessagingException
- see javadoc for MimeMessage(javax.mail.internet.MimeMessage)
public static ExtendedMimeMessage wrap(javax.mail.internet.MimeMessage message)
MimeMessage
into an ExtendedMimeMessage
, without double wrapping.message
- the MimeMessage
to wrap.ExtendedMimeMessage
.RuntimeException
- if an error occurs during the conversion, which is unexpected if the initial message
is a fully formed MimeMessage or already an ExtendedMimeMessage.public boolean isEmpty()
public void setType(String mailType)
mailType
- the type of mail being sent (e.g "Watchlist", "Reset Password", "Send Page by Mail", etc)public String getType()
setType(String)
).public void setMessageId(String messageId)
messageId
- message identifier to be set on the message header.public boolean ensureSaved() throws javax.mail.MessagingException
javax.mail.MessagingException
- on errorpublic void setHeader(String name, String value) throws javax.mail.MessagingException
setHeader
in interface javax.mail.Part
setHeader
in class javax.mail.internet.MimeMessage
javax.mail.MessagingException
public String getUniqueMessageId()
Copyright © 2004–2021 XWiki. All rights reserved.