com.objectxp.msg
Class SmtpMessage

java.lang.Object
  extended by com.objectxp.msg.Message
      extended by com.objectxp.msg.SmtpMessage
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class SmtpMessage
extends Message

This class extends the generic Message class with SMTP specific properties. The Message may have multiple Recipients and a Subject.

See Also:
SmtpService, Serialized Form

Field Summary
 
Fields inherited from class com.objectxp.msg.Message
ACK_TIME, MT_BINARY, MT_STATUS, MT_TEXT, SENDER_TYPE_ALPHA, SENDER_TYPE_GUESS, SENDER_TYPE_NUMBER
 
Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class com.objectxp.msg.Message
clone, getBytes, getID, getMessage, getProperty, getRecipient, getSender, getSenderType, getTimestamp, getType, setID, setMessage, setMessage, setProperty, setSender, setSenderType, setType, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SmtpMessage

public SmtpMessage()
Create a new empty SMTP message.


SmtpMessage

public SmtpMessage(java.lang.String recipient,
                   java.lang.String sender,
                   java.lang.String subject,
                   java.lang.String message)
Create a new SMTP message.

Parameters:
recipient - the mail address of the recipient for this message. The recipient will be of type Recipient.RT_TO
sender - the senders mail address.
subject - the subject of this message
message - the message body
See Also:
Recipient.RT_TO

SmtpMessage

public SmtpMessage(Message message)
Create a new SMTP message based on an existing Message object.

Method Detail

addRecipient

public void addRecipient(Recipient recipient)
Add a new recipient to the list of recipients for this message.


addRecipient

public void addRecipient(java.lang.String address)
Add a new recipient to the list of recipients for this message. The Recipient will be of type Recipient.RT_TO


addRecipient

public void addRecipient(java.lang.String address,
                         int type)
Add a new recipient to the list of recipients for this message.

Parameters:
address - a valid Internet mail address (user@domain)
type - the Recipient type
See Also:
Recipient

setRecipient

public void setRecipient(java.lang.String address)
Set the recipient for this message. the current list of recipients will be cleared first. The recipient will be of type Recipient.RT_TO.

Overrides:
setRecipient in class Message
Parameters:
address - address of the recipient

clearRecipients

public void clearRecipients()
Clear the list of recipients for this message.


getRecipients

public java.lang.String[] getRecipients()
Get the Addresses for all recipients of this message.


getSubject

public java.lang.String getSubject()
Get the subject for this message.


setSubject

public void setSubject(java.lang.String subject)
set the Subject for this message.



object XP, Inc. © 2000-2008. All rights reserved object XP