OpenAPI 1.0

com.aquafold.openapi.mail
Interface AQMailMessage


public interface AQMailMessage

This interface defines an email message which can be delivered to recipients via either AQSmtpServer or AQMailQueue.

An instance of the object that implements the AQMailMessage interface can be instantiated via aqua.mail.newMessage() alias.


Method Summary
 void addBCCRecipient(String address)
          Add a valid email address, or a list of comma separated email addresses, to the list of blind carbon copy (BCC:) recipients.
 void addByteArrayAttachment(byte[] bytes, String attachmentName)
          Adds a byte array as an attachment.
 void addCCRecipient(String address)
          Add a valid email address, or a list of comma separated email addresses, to the list of carbon copy (CC:) recipients.
 void addFileAttachment(File filename)
          Add a file on the local file system as an attachment.
 void addFileAttachment(String filename)
          Add a file on the local file system as an attachment.
 void addFileAttachment(String filename, String attachmentName)
          Add a file on the local file system as an attachment with attachment name specified.
 void addHadoopFileAttachment(AQHadoopDistributedFileSystem system, String filename, String attachmentName)
          Add a file on a Hadoop file system as an attachment.
 void addProjectFileAttachment(AQProjectFile file)
          Adds a AQProjectFile as an attachment.
 void addProjectFileAttachment(AQProjectFile file, String attachmentName)
          Adds a AQProjectFile as an attachment.
 void addReplyTo(String replyTo)
          Add a valid email address, or a list of comma separated email addresses, to the list of addresses to which replies should be directed.
 void addToRecipient(String recipient)
          Add a valid email address, or a list of comma separated email addresses, to the list of recipients.
 String[] getBCCRecipients()
          Returns a list of BCC: recipients, an empty array is returned if recipients are not defined.
 String[] getCCRecipients()
          Returns a list of CC: recipients, an empty array is returned if recipients are not defined.
 String[] getFileAttachments()
          Returns the list of file attachments, an empty array is returned if this message contains no file attachments.
 String getFrom()
          Returns message sender email address or null if the address is not defined.
 String getHtmlText()
          Returns message HTML text content or null if the HTML content is not defined.
 String[] getReplyTo()
          Returns the list of addresses to which replies should be directed, an empty array is returned if Reply-To addresses are not defined.
 String getSubject()
          Returns message subject or null if the message subject is not defined.
 String getText()
          Returns message plain text content or null if the plain text content is not defined.
 String[] getToRecipients()
          Returns a list of recipients, an empty array is returned if recipients are not defined.
 void queue()
          Delivers this message to recipients using the default AQMailQueue.
 void send()
          Delivers this message to recipients using the default AQSmtpServer.
 void setFrom(String sender)
          Sets sender email address.
 void setHtmlText(String htmlText)
          Set message HTML content.
 void setSubject(String subject)
          Set message subject.
 void setText(String text)
          Set message plain text content.
 

Method Detail

setFrom

void setFrom(String sender)
Sets sender email address. Sender email address is required in order to get mail delivered.

Parameters:
sender - Sender email address.

getFrom

String getFrom()
Returns message sender email address or null if the address is not defined.


addToRecipient

void addToRecipient(String recipient)
Add a valid email address, or a list of comma separated email addresses, to the list of recipients. At least one recipient needs to be defined in order to get mail delivered.

Parameters:
recipient - To: email address, or a list of comma separated email addresses.

getToRecipients

String[] getToRecipients()
Returns a list of recipients, an empty array is returned if recipients are not defined.


addCCRecipient

void addCCRecipient(String address)
Add a valid email address, or a list of comma separated email addresses, to the list of carbon copy (CC:) recipients.

Parameters:
address - CC: email address, or a list of comma separated email addresses.

getCCRecipients

String[] getCCRecipients()
Returns a list of CC: recipients, an empty array is returned if recipients are not defined.


addBCCRecipient

void addBCCRecipient(String address)
Add a valid email address, or a list of comma separated email addresses, to the list of blind carbon copy (BCC:) recipients.

Parameters:
address - BCC: email address, or a list of comma separated email addresses.

getBCCRecipients

String[] getBCCRecipients()
Returns a list of BCC: recipients, an empty array is returned if recipients are not defined.


addReplyTo

void addReplyTo(String replyTo)
Add a valid email address, or a list of comma separated email addresses, to the list of addresses to which replies should be directed.

Parameters:
replyTo - email address, or a list of comma separated email addresses.

getReplyTo

String[] getReplyTo()
Returns the list of addresses to which replies should be directed, an empty array is returned if Reply-To addresses are not defined.


setSubject

void setSubject(String subject)
Set message subject. Subject cannot be null, empty string is fine.

Parameters:
subject - Message subject.

getSubject

String getSubject()
Returns message subject or null if the message subject is not defined.


setText

void setText(String text)
Set message plain text content.

Parameters:
text - Message plain text content, ignored if null.

getText

String getText()
Returns message plain text content or null if the plain text content is not defined.


setHtmlText

void setHtmlText(String htmlText)
Set message HTML content.

Parameters:
htmlText - Message HTML content, ignored if null.

getHtmlText

String getHtmlText()
Returns message HTML text content or null if the HTML content is not defined.


addFileAttachment

void addFileAttachment(String filename)
                       throws Exception
Add a file on the local file system as an attachment. The base name of the specified file name will be used as attachment name.

Parameters:
filename - the file name.
Throws:
Exception - if the specified file does not exist or inaccessible

addFileAttachment

void addFileAttachment(File filename)
                       throws Exception
Add a file on the local file system as an attachment. The base name of the specified file will be used as attachment name.

Parameters:
filename - the file name.
Throws:
Exception - if the specified file does not exist or inaccessible

addFileAttachment

void addFileAttachment(String filename,
                       String attachmentName)
                       throws Exception
Add a file on the local file system as an attachment with attachment name specified.

Parameters:
filename - the file name.
attachmentName - the name to be used to name the attachment
Throws:
Exception - if the specified file does not exist or inaccessible

getFileAttachments

String[] getFileAttachments()
Returns the list of file attachments, an empty array is returned if this message contains no file attachments. File attachments are those attachments added by addFileAttachment(String filename) or addFileAttachment(File filename).


addByteArrayAttachment

void addByteArrayAttachment(byte[] bytes,
                            String attachmentName)
Adds a byte array as an attachment.

Parameters:
bytes - the byte array
attachmentName - the name to be used to name the attachment

addProjectFileAttachment

void addProjectFileAttachment(AQProjectFile file)
Adds a AQProjectFile as an attachment. The base name of the specified file will be used as attachment name.

Parameters:
file - the project file

addProjectFileAttachment

void addProjectFileAttachment(AQProjectFile file,
                              String attachmentName)
Adds a AQProjectFile as an attachment.

Parameters:
file - the project file
attachmentName - the name to be used to name the attachment

addHadoopFileAttachment

void addHadoopFileAttachment(AQHadoopDistributedFileSystem system,
                             String filename,
                             String attachmentName)
                             throws Exception
Add a file on a Hadoop file system as an attachment.

Parameters:
system - the Hadoop file system where file is located
filename - the name of the file on the Hadoop file system
attachmentName - the name to be used to name the attachment
Throws:
Exception - if the specified file does not exist or inaccessible

send

void send()
          throws Exception
Delivers this message to recipients using the default AQSmtpServer.

Throws:
Exception

queue

void queue()
           throws Exception
Delivers this message to recipients using the default AQMailQueue.

Throws:
Exception

OpenAPI 1.0


Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.