public class SmtpMessage extends Message
SmtpService
,
Serialized FormACK_TIME, MT_BINARY, MT_STATUS, MT_TEXT, SENDER_TYPE_ALPHA, SENDER_TYPE_GUESS, SENDER_TYPE_NUMBER
Constructor and Description |
---|
SmtpMessage()
Create a new empty SMTP message.
|
SmtpMessage(Message message)
Create a new SMTP message based on an existing Message object.
|
SmtpMessage(java.lang.String recipient,
java.lang.String sender,
java.lang.String subject,
java.lang.String message)
Create a new SMTP message.
|
Modifier and Type | Method and Description |
---|---|
void |
addRecipient(Recipient recipient)
Add a new recipient to the list of recipients for this message.
|
void |
addRecipient(java.lang.String address)
Add a new recipient to the list of recipients for this message.
|
void |
addRecipient(java.lang.String address,
int type)
Add a new recipient to the list of recipients for this message.
|
void |
clearRecipients()
Clear the list of recipients for this message.
|
java.lang.String[] |
getRecipients()
Get the Addresses for all recipients of this message.
|
java.lang.String |
getSubject()
Get the subject for this message.
|
void |
setRecipient(java.lang.String address)
Set the recipient for this message. the current list of recipients
will be cleared first.
|
void |
setSubject(java.lang.String subject)
set the Subject for this message.
|
clone, getBytes, getID, getMessage, getProperty, getRecipient, getSender, getSenderType, getTimestamp, getType, setID, setMessage, setMessage, setProperty, setSender, setSenderType, setType, toString
public SmtpMessage()
public SmtpMessage(java.lang.String recipient, java.lang.String sender, java.lang.String subject, java.lang.String message)
recipient
- the mail address of the recipient for this message. The
recipient will be of type Recipient.RT_TOsender
- the senders mail address.subject
- the subject of this messagemessage
- the message bodyRecipient.RT_TO
public SmtpMessage(Message message)
public void addRecipient(Recipient recipient)
public void addRecipient(java.lang.String address)
Recipient.RT_TO
public void addRecipient(java.lang.String address, int type)
address
- a valid Internet mail address (user@domain)type
- the Recipient typeRecipient
public void setRecipient(java.lang.String address)
Recipient.RT_TO
.setRecipient
in class Message
address
- address of the recipientpublic void clearRecipients()
public java.lang.String[] getRecipients()
public java.lang.String getSubject()
public void setSubject(java.lang.String subject)
object XP, Inc. © 2000-2013. All rights reserved object XP