public class ScriptMimeMessage extends ExtendedMimeMessage
MimeMessage
with additional helper methods for scripts.Modifier and Type | Method and Description |
---|---|
void |
addHeader(String name,
String value)
Add a mail header.
|
void |
addPart(javax.mail.BodyPart bodyPart)
Add some content to the mail to be sent.
|
javax.mail.BodyPart |
addPart(String mimeType,
Object content)
Add some content to the mail to be sent.
|
javax.mail.BodyPart |
addPart(String mimeType,
Object content,
Map<String,Object> parameters)
Add some content to the mail to be sent.
|
void |
addRecipient(javax.mail.Message.RecipientType type,
javax.mail.Address address) |
void |
addRecipients(javax.mail.Message.RecipientType type,
javax.mail.Address[] addresses) |
void |
setFrom(javax.mail.Address address) |
void |
setSubject(String subject) |
ensureSaved, getType, getUniqueMessageId, isEmpty, setHeader, setMessageId, setType, wrap
addFrom, addHeaderLine, 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, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setText, setText, setText, updateHeaders, updateMessageID, writeTo, writeTo
public void addPart(javax.mail.BodyPart bodyPart)
bodyPart
- a BodyPart
object to include in the mailpublic javax.mail.BodyPart addPart(String mimeType, Object content)
mimeType
- the mime type of the content parametercontent
- the content to include in the mail. The type depends on the mimetype. For example for a mime
type of text/plain
or text/html
, the content should be a String, for a mime type of
xwiki/template
it should be a DocumentReference
, etc.
Also accepts a BodyPart
object, in which case, the mime type is not used.public javax.mail.BodyPart addPart(String mimeType, Object content, Map<String,Object> parameters)
mimeType
- the mime type of the content parametercontent
- the content to include in the mail. The type depends on the mimetype. For example for a mime
type of text/plain
or text/html
, the content should be a String, for a mime type of
xwiki/template
it should be a DocumentReference
, etc.
Also accepts a BodyPart
object, in which case, the mime type and parameters are not used.parameters
- the list of extra parameters. This is used for example to pass alternate content for the mail
using the alternate
key in the HTML Mime Body Part Factory. Mail headers can also be passed using
the headers
key with a Map<String, String>
value containing header keys
and values.public void setSubject(String subject)
setSubject
in class javax.mail.internet.MimeMessage
subject
- the subject to set in the Mime Messagepublic void setFrom(javax.mail.Address address)
setFrom
in class javax.mail.internet.MimeMessage
address
- the address from which this message will be sentpublic void addRecipients(javax.mail.Message.RecipientType type, javax.mail.Address[] addresses)
addRecipients
in class javax.mail.internet.MimeMessage
type
- the type of recipients (to, cc, bcc, newsgroups)addresses
- the email addresses of the recipientspublic void addRecipient(javax.mail.Message.RecipientType type, javax.mail.Address address)
addRecipient
in class javax.mail.Message
type
- the type of recipient (to, cc, bcc, newsgroups)address
- the email address of the recipientCopyright © 2004–2021 XWiki. All rights reserved.