org.jboss.seam.mail.core
Class EmailMessage

java.lang.Object
  extended by org.jboss.seam.mail.core.EmailMessage

public class EmailMessage
extends Object

Stores infomation about an EmailMessage while it is being build and after sending

Author:
Cody Lerum

Constructor Summary
EmailMessage()
           
 
Method Summary
 void addAttachment(EmailAttachment attachment)
          Adds an EmailAttachment to the EmailMessage
 void addAttachments(Collection<? extends EmailAttachment> attachments)
          Adds a Collection of EmailAttachment to the EmailMessage
 void addBccAddress(InternetAddress bccAddress)
          Adds a single InternetAddress to the BCC addresses on the EmailMessage
 void addBccAddresses(Collection<InternetAddress> bccAddresses)
          Adds a Collection of InternetAddress to the BCC addresses on the
 void addCcAddress(InternetAddress ccAddress)
          Adds a single InternetAddress to the CC addresses on the EmailMessage
 void addCcAddresses(Collection<InternetAddress> ccAddresses)
          Adds a Collection of InternetAddress to the CC addresses on the
 void addDeliveryReceiptAddress(InternetAddress address)
          Adds a InternetAddress as a Delivery Receipt address
 void addDeliveryReceiptAddresses(Collection<InternetAddress> deliveryReceiptAddresses)
          Adds a Collection of InternetAddress as a Delivery Receipt address
 void addFromAddress(InternetAddress fromAddress)
          Adds a single InternetAddress to the FROM addresses on the EmailMessage
 void addFromAddresses(Collection<InternetAddress> fromAddresses)
          Adds a Collection of InternetAddress to the FROM addresses on the EmailMessage
 void addHeader(Header header)
          Add a single Header to the EmailMessage
 void addHeaders(Collection<Header> headers)
          Add a Collection of Header to the EmailMessage
 void addReadReceiptAddress(InternetAddress address)
          Adds a InternetAddress as a Read Receipt address
 void addReadReceiptAddresses(Collection<InternetAddress> readReceiptAddresses)
          Adds a Collection of InternetAddress as a Read Receipt address
 void addReplyToAddress(InternetAddress replyToAddress)
          Adds a single InternetAddress to the REPLY-TO addresses on the EmailMessage
 void addReplyToAddresses(Collection<InternetAddress> replyToAddresses)
          Adds a Collection of InternetAddress to the REPLY-TO addresses on the
 void addToAddress(InternetAddress toAddress)
          Adds a single InternetAddress to the TO addresses on the EmailMessage
 void addToAddresses(Collection<InternetAddress> toAddresses)
          Adds a Collection of InternetAddress to the TO addresses on the
 List<EmailAttachment> getAttachments()
          Gets a Collection representing all the Attachments on the EmailMessage
 List<InternetAddress> getBccAddresses()
          Get the Collection of BCC addresses on the EmailMeassage
 List<InternetAddress> getCcAddresses()
          Get the Collection of CC addresses on the EmailMeassage
 List<InternetAddress> getDeliveryReceiptAddresses()
          Get the collection of InternetAddress which are Delivery Reciept addresses
 List<InternetAddress> getFromAddresses()
          Get the Collection of FROM addresses on the EmailMeassage
 List<Header> getHeaders()
          Get a Collection of additional headers added to the EmailMessage
 String getHtmlBody()
          Get the HTML Body of the EmailMessage
 MessagePriority getImportance()
          Get the Current Importance of the EmailMessage.
 String getLastMessageId()
          Gets the Message-ID after the EmailMeassage has been sent.
 String getMessageId()
          Gets the Message-ID of the EmailMeassage.
 List<InternetAddress> getReadReceiptAddresses()
          Get the collection of InternetAddress which are Read Receipt addresses
 List<InternetAddress> getReplyToAddresses()
          Get the Collection of REPLY-TO addresses on the EmailMeassage
 ContentType getRootContentType()
          Get the Root Mime ContentType of the EmailMessage
 String getSubject()
          Get the Subject of the EmailMessage
 String getTextBody()
          Get the Text Body of the EmailMessage
 List<InternetAddress> getToAddresses()
          Get the Collection of TO addresses on the EmailMeassage
 EmailMessageType getType()
          Get the current EmailMessageType of the EmailMessage
 boolean removeBccAddress(InternetAddress bccAddress)
          Remove an InternetAddress from the BCC addressses
 boolean removeCcAddress(InternetAddress ccAddress)
          Remove an InternetAddress from the CC addressses
 boolean removeToAddress(InternetAddress toAddress)
          Remove an InternetAddress from the TO addressses
 void setAttachments(List<EmailAttachment> attachments)
           
 void setBccAddresses(List<InternetAddress> bccAddresses)
           
 void setCcAddresses(List<InternetAddress> ccAddresses)
           
 void setDeliveryReceiptAddresses(List<InternetAddress> deliveryReceiptAddresses)
           
 void setFromAddresses(List<InternetAddress> fromAddresses)
           
 void setHeaders(List<Header> headers)
           
 void setHtmlBody(String htmlBody)
          Set the HTML Body of the EmailMessage
 void setImportance(MessagePriority importance)
          Sets the MessagePriority of the EmailMessage
 void setLastMessageId(String lastMessageId)
          Sents the Message-ID after the EmailMeassage has been sent.
 void setMessageId(String messageId)
          Sets the Message-ID for the EmailMeassage.
 void setReadReceiptAddresses(List<InternetAddress> readReceiptAddresses)
           
 void setReplyToAddresses(List<InternetAddress> replyToAddresses)
           
 void setRootContentType(ContentType rootContentType)
          Set the Root Mime ContentType of the EmailMessage
 void setSubject(String subject)
          Sets the Subject on the EmailMessage
 void setTextBody(String textBody)
          Set the Text Body of the EmailMessage
 void setToAddresses(List<InternetAddress> toAddresses)
           
 void setType(EmailMessageType type)
          Sets the EmailMessageType of the EmailMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailMessage

public EmailMessage()
Method Detail

getRootContentType

public ContentType getRootContentType()
Get the Root Mime ContentType of the EmailMessage

Returns:
Root Mime ContentType of the EmailMessage

setRootContentType

public void setRootContentType(ContentType rootContentType)
Set the Root Mime ContentType of the EmailMessage

Parameters:
rootContentType - SubType to set

getType

public EmailMessageType getType()
Get the current EmailMessageType of the EmailMessage

Returns:
EmailMessageType of this EmailMessage

setType

public void setType(EmailMessageType type)
Sets the EmailMessageType of the EmailMessage

Parameters:
type - EmailMessageType to set on the EmailMessage

getMessageId

public String getMessageId()
Gets the Message-ID of the EmailMeassage. This nulled after sending.

Returns:
Message-ID of the EmailMeassage

setMessageId

public void setMessageId(String messageId)
Sets the Message-ID for the EmailMeassage. Should be in RFC822 format

Parameters:
messageId - Globally unique Message-ID example 1234.5678@test.com

getLastMessageId

public String getLastMessageId()
Gets the Message-ID after the EmailMeassage has been sent.

Returns:
Message-ID which was set on the last send.

setLastMessageId

public void setLastMessageId(String lastMessageId)
Sents the Message-ID after the EmailMeassage has been sent.

Parameters:
lastMessageId - Message-ID to be set.

getFromAddresses

public List<InternetAddress> getFromAddresses()
Get the Collection of FROM addresses on the EmailMeassage

Returns:
Collection of InternetAddresses addresses

setFromAddresses

public void setFromAddresses(List<InternetAddress> fromAddresses)

addFromAddress

public void addFromAddress(InternetAddress fromAddress)
Adds a single InternetAddress to the FROM addresses on the EmailMessage

Parameters:
fromAddress -

addFromAddresses

public void addFromAddresses(Collection<InternetAddress> fromAddresses)
Adds a Collection of InternetAddress to the FROM addresses on the EmailMessage

Parameters:
fromAddresses -

getReplyToAddresses

public List<InternetAddress> getReplyToAddresses()
Get the Collection of REPLY-TO addresses on the EmailMeassage

Returns:
Collection of InternetAddresses addresses

setReplyToAddresses

public void setReplyToAddresses(List<InternetAddress> replyToAddresses)

addReplyToAddress

public void addReplyToAddress(InternetAddress replyToAddress)
Adds a single InternetAddress to the REPLY-TO addresses on the EmailMessage

Parameters:
replyToAddress - InternetAddress to set

addReplyToAddresses

public void addReplyToAddresses(Collection<InternetAddress> replyToAddresses)
Adds a Collection of InternetAddress to the REPLY-TO addresses on the

Parameters:
replyToAddresses - Collection of InternetAddress to add

getToAddresses

public List<InternetAddress> getToAddresses()
Get the Collection of TO addresses on the EmailMeassage

Returns:
Collection of InternetAddresses addresses

addToAddress

public void addToAddress(InternetAddress toAddress)
Adds a single InternetAddress to the TO addresses on the EmailMessage

Parameters:
toAddress - InternetAddress to set

addToAddresses

public void addToAddresses(Collection<InternetAddress> toAddresses)
Adds a Collection of InternetAddress to the TO addresses on the

Parameters:
toAddresses - Collection of InternetAddress to add

setToAddresses

public void setToAddresses(List<InternetAddress> toAddresses)

removeToAddress

public boolean removeToAddress(InternetAddress toAddress)
Remove an InternetAddress from the TO addressses

Parameters:
toAddress -
Returns:
true if address was removed. false if it did not exist.

getCcAddresses

public List<InternetAddress> getCcAddresses()
Get the Collection of CC addresses on the EmailMeassage

Returns:
Collection of InternetAddresses addresses

setCcAddresses

public void setCcAddresses(List<InternetAddress> ccAddresses)

addCcAddress

public void addCcAddress(InternetAddress ccAddress)
Adds a single InternetAddress to the CC addresses on the EmailMessage

Parameters:
ccAddress - InternetAddress to set

addCcAddresses

public void addCcAddresses(Collection<InternetAddress> ccAddresses)
Adds a Collection of InternetAddress to the CC addresses on the

Parameters:
ccAddresses - Collection of InternetAddress to add

removeCcAddress

public boolean removeCcAddress(InternetAddress ccAddress)
Remove an InternetAddress from the CC addressses

Parameters:
ccAddress -
Returns:
true if address was removed. false if it did not exist.

getBccAddresses

public List<InternetAddress> getBccAddresses()
Get the Collection of BCC addresses on the EmailMeassage

Returns:
Collection of InternetAddresses addresses

setBccAddresses

public void setBccAddresses(List<InternetAddress> bccAddresses)

addBccAddress

public void addBccAddress(InternetAddress bccAddress)
Adds a single InternetAddress to the BCC addresses on the EmailMessage

Parameters:
bccAddress - InternetAddress to set

addBccAddresses

public void addBccAddresses(Collection<InternetAddress> bccAddresses)
Adds a Collection of InternetAddress to the BCC addresses on the

Parameters:
bccAddresses - Collection of InternetAddress to add

removeBccAddress

public boolean removeBccAddress(InternetAddress bccAddress)
Remove an InternetAddress from the BCC addressses

Parameters:
bccAddress -
Returns:
true if address was removed. false if it did not exist.

getHeaders

public List<Header> getHeaders()
Get a Collection of additional headers added to the EmailMessage

Returns:
Collection of Header

setHeaders

public void setHeaders(List<Header> headers)

addHeader

public void addHeader(Header header)
Add a single Header to the EmailMessage

Parameters:
header - Header to set

addHeaders

public void addHeaders(Collection<Header> headers)
Add a Collection of Header to the EmailMessage

Parameters:
headers - Collection of Header to add to EmailMessage

getSubject

public String getSubject()
Get the Subject of the EmailMessage

Returns:
The Subject

setSubject

public void setSubject(String subject)
Sets the Subject on the EmailMessage

Parameters:
subject - Subject to be set

getTextBody

public String getTextBody()
Get the Text Body of the EmailMessage

Returns:
The EmailMessage Text Body.

setTextBody

public void setTextBody(String textBody)
Set the Text Body of the EmailMessage

Parameters:
textBody - Text Body to be set

getHtmlBody

public String getHtmlBody()
Get the HTML Body of the EmailMessage

Returns:
The EmailMessage HTML Body.

setHtmlBody

public void setHtmlBody(String htmlBody)
Set the HTML Body of the EmailMessage

Parameters:
htmlBody - HTML Body to be set

getDeliveryReceiptAddresses

public List<InternetAddress> getDeliveryReceiptAddresses()
Get the collection of InternetAddress which are Delivery Reciept addresses

Returns:
Collection of InternetAddress

setDeliveryReceiptAddresses

public void setDeliveryReceiptAddresses(List<InternetAddress> deliveryReceiptAddresses)

addDeliveryReceiptAddress

public void addDeliveryReceiptAddress(InternetAddress address)
Adds a InternetAddress as a Delivery Receipt address

Parameters:
address - InternetAddress to be added

addDeliveryReceiptAddresses

public void addDeliveryReceiptAddresses(Collection<InternetAddress> deliveryReceiptAddresses)
Adds a Collection of InternetAddress as a Delivery Receipt address

Parameters:
deliveryReceiptAddresses - Collection of InternetAddress to be added

getReadReceiptAddresses

public List<InternetAddress> getReadReceiptAddresses()
Get the collection of InternetAddress which are Read Receipt addresses

Returns:
Collection of InternetAddress

setReadReceiptAddresses

public void setReadReceiptAddresses(List<InternetAddress> readReceiptAddresses)

addReadReceiptAddress

public void addReadReceiptAddress(InternetAddress address)
Adds a InternetAddress as a Read Receipt address

Parameters:
address - InternetAddress to be added

addReadReceiptAddresses

public void addReadReceiptAddresses(Collection<InternetAddress> readReceiptAddresses)
Adds a Collection of InternetAddress as a Read Receipt address

Parameters:
readReceiptAddresses - Collection of InternetAddress to be added

getImportance

public MessagePriority getImportance()
Get the Current Importance of the EmailMessage. Default is normal. No Header added

Returns:
MessagePriority of EmailMessage

setImportance

public void setImportance(MessagePriority importance)
Sets the MessagePriority of the EmailMessage

Parameters:
importance - MessagePriority to be set.

addAttachment

public void addAttachment(EmailAttachment attachment)
Adds an EmailAttachment to the EmailMessage

Parameters:
attachment - EmailAttachment to be added

addAttachments

public void addAttachments(Collection<? extends EmailAttachment> attachments)
Adds a Collection of EmailAttachment to the EmailMessage

Parameters:
attachments - Collection of EmailAttachment

getAttachments

public List<EmailAttachment> getAttachments()
Gets a Collection representing all the Attachments on the EmailMessage

Returns:
Collection of EmailAttachment

setAttachments

public void setAttachments(List<EmailAttachment> attachments)


Copyright © 2011 Seam Framework. All Rights Reserved.