|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwt.mail.EMailMessage
public class EMailMessage
An instance of this class represents an e-mail message. The subject and text bodies of the e-mail message are defined in terms of resource bundles, keys of entries within the bundles, and arrays of strings to be inserted into the entries. Various types of objects from which principals can be obtained may be added as recipients of the message. The message may be constructed as a multipart message, and the individual parts can be specified as text bodies or as URL's from which objects of any type may be read.
Use the newEMailMessage static factory method(s), not the
EMailMessage constructor, to construct instances of this
class. Instances must be constructed using the static factory(s), in
order to ensure proper initialization of the instance.
Supported API: true
Extendable: false
| Field Summary | |
|---|---|
static String |
MULTIPART_SUBTYPE
Label for the attribute. |
static String |
ORIGINATOR
Label for the attribute. |
| Method Summary | |
|---|---|
void |
addPart(String resource,
String key,
Object[] inserts,
String contentType)
Add a textual message body of a specific MIME content type to the message. |
void |
addPart(URL url)
Add a message body whose content is read from a URL. |
void |
addRecipient(WTPrincipal recipient)
Add a specific principal as a recipient of the message. |
void |
addRecipient(WTPrincipalReference recipient)
Add a specific principal by reference as a recipient of the message. |
String |
getMultipartSubtype()
Gets the value of the attribute: MULTIPART_SUBTYPE. |
WTPrincipalReference |
getOriginator()
Gets the value of the attribute: ORIGINATOR. |
Enumeration |
getRecipients()
Return the current list of recipients as an enumeration of objects. |
protected void |
initialize()
Supports initialization, following construction of an instance. |
static EMailMessage |
newEMailMessage()
Construct a new instance with no recipients, subject, or content. |
void |
send(boolean immediate)
Submit the message for delivery to its intended recipients. |
void |
setMultipartSubtype(String a_MultipartSubtype)
Sets the value of the attribute: MULTIPART_SUBTYPE. |
void |
setOriginator(WTPrincipal originator)
Set the originator of the message. |
void |
setOriginator(WTPrincipalReference a_Originator)
Sets the value of the attribute: ORIGINATOR. |
void |
setSubject(String resource,
String key,
Object[] inserts)
Set the resource bundle, key, and inserts from which the subject of the message will be obtained. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String ORIGINATOR
public static final String MULTIPART_SUBTYPE
| Method Detail |
|---|
public WTPrincipalReference getOriginator()
public void setOriginator(WTPrincipalReference a_Originator)
a_Originator - public String getMultipartSubtype()
public void setMultipartSubtype(String a_MultipartSubtype)
a_MultipartSubtype -
public static EMailMessage newEMailMessage()
throws WTException
WTException
protected void initialize()
throws WTException
WTException
public void setOriginator(WTPrincipal originator)
throws WTException
originator - The principal who is designated as the originator of the message.
WTException
public void setSubject(String resource,
String key,
Object[] inserts)
resource - The name of the resource bundle containing the subject.key - The key that identifies the entry within the resource bundle providing the message subject.inserts - The objects to be inserted into the resource bundle entry to produce the subject string.
public void addRecipient(WTPrincipal recipient)
throws WTException
recipient - The principal to add as recipient.
WTException
public void addRecipient(WTPrincipalReference recipient)
throws WTException
recipient - The reference to the principal to be added as recipient.
WTExceptionpublic Enumeration getRecipients()
public void addPart(String resource,
String key,
Object[] inserts,
String contentType)
resource - The name of the resource bundle.key - The key of the resource within the bundle that contains the message body.inserts - The objects, if any, to be inserted into the message body.contentType - The MIME content type of the message body, .e.g., "text/html" or "text/plain".public void addPart(URL url)
url - The URL of the remote resource that provides the message body.
public void send(boolean immediate)
throws WTException
immediate - Indicates whether to submit the message to the mail server immediately (true), or place the message in a queue where it will be submitted to the mail server by a background process (false).
WTException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||