com.webmethods.caf.faces.data.email
Class EmailDeliverer

java.lang.Object
  extended by com.webmethods.caf.faces.data.email.EmailDeliverer

public class EmailDeliverer
extends Object

Simple Provider to make it easy to send email through the JavaMail support provided by the server.

Since:
8.0

Nested Class Summary
protected static class EmailDeliverer.MessageBodyDataSource
          Inner class to EmailDeliverer.
 
Field Summary
protected  String bccAddresses
           
protected  String body
           
protected  String ccAddresses
           
protected  String contentType
           
protected  IErrorHandler errorHandler
           
protected  String fromAddress
           
protected  String replyToAddress
           
protected  String senderAddress
           
protected  String sessionJNDIName
           
protected  String subject
           
protected  String toAddresses
           
 
Constructor Summary
EmailDeliverer()
           
 
Method Summary
protected  void addExtraBodyParts(MimeMultipart multipart)
          Subclasses may override to embed images or other attachments in the mime message.
protected  DataSource createBodyDataSource()
          Factory method that can be overridden to provide a different implementation.
 String deliverEmail()
          Action handler that delivers an email message given the specified data.
 String getBccAddresses()
          Get the blind copy addresses for this email.
 String getBody()
          Get the body text for this email.
 String getCcAddresses()
          Get the carbon copy addresses for this email.
 String getContentType()
          Get the content type for this email.
 IErrorHandler getErrorHandler()
           
 String getFromAddress()
          Get the from address for this email.
 String getReplyToAddress()
          Set the reply to address for this email.
 String getSenderAddress()
          Get the sender address for this email.
 String getSessionJNDIName()
          Get the session JNDI name.
 String getSubject()
          Get the subject text for this email.
 String getToAddresses()
          Get the to addresses for this email.
 void setBccAddresses(String bccAddresses)
          Set the blind copy addresses for this email.
 void setBody(String body)
          Set the body text for this email.
 void setCcAddresses(String ccAddresses)
          Set the carbon copy addresses for this email.
 void setContentType(String contentType)
          Set the content type for this email.
 void setErrorHandler(IErrorHandler errorHandler)
           
 void setFromAddress(String fromAddress)
          Set the from address for this email.
 void setReplyToAddress(String replyToAddress)
          Set the reply to address for this email.
 void setSenderAddress(String senderAddress)
          Set the sender address for this email.
 void setSessionJNDIName(String sessionJNDIName)
          Set the session JNDI name.
 void setSubject(String subject)
          Set the subject text for this email.
 void setToAddresses(String toAddresses)
          Set the to addresses for this email.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

errorHandler

protected IErrorHandler errorHandler

sessionJNDIName

protected String sessionJNDIName

toAddresses

protected String toAddresses

ccAddresses

protected String ccAddresses

bccAddresses

protected String bccAddresses

replyToAddress

protected String replyToAddress

subject

protected String subject

body

protected String body

contentType

protected String contentType

fromAddress

protected String fromAddress

senderAddress

protected String senderAddress
Constructor Detail

EmailDeliverer

public EmailDeliverer()
Method Detail

getErrorHandler

public IErrorHandler getErrorHandler()

setErrorHandler

public void setErrorHandler(IErrorHandler errorHandler)

getSessionJNDIName

public String getSessionJNDIName()
Get the session JNDI name. Default is "mail/Session".

Returns:
The sessionJNDIName

setSessionJNDIName

public void setSessionJNDIName(String sessionJNDIName)
Set the session JNDI name.

Parameters:
sessionJNDIName - The session JNDI Name.

getToAddresses

public String getToAddresses()
Get the to addresses for this email.

Returns:
The to addresses

setToAddresses

public void setToAddresses(String toAddresses)
Set the to addresses for this email.

Parameters:
toAddresses - The to addresses.

getCcAddresses

public String getCcAddresses()
Get the carbon copy addresses for this email.

Returns:
String The carbon copy addresses.

setCcAddresses

public void setCcAddresses(String ccAddresses)
Set the carbon copy addresses for this email.

Parameters:
ccAddresses - The carbon copy addresses.

getBccAddresses

public String getBccAddresses()
Get the blind copy addresses for this email.

Returns:
The blind copy addresses.

setBccAddresses

public void setBccAddresses(String bccAddresses)
Set the blind copy addresses for this email.

Parameters:
bccAddresses - The blind copy addresses.

getFromAddress

public String getFromAddress()
Get the from address for this email.

Returns:
The from address.

setFromAddress

public void setFromAddress(String fromAddress)
Set the from address for this email.

Parameters:
fromAddress - The from address.

getReplyToAddress

public String getReplyToAddress()
Set the reply to address for this email.

Returns:
The reply to Address.

setReplyToAddress

public void setReplyToAddress(String replyToAddress)
Set the reply to address for this email.

Parameters:
replyToAddress - The reply to Address.

getSenderAddress

public String getSenderAddress()
Get the sender address for this email.

Returns:
The sender address.

setSenderAddress

public void setSenderAddress(String senderAddress)
Set the sender address for this email.

Parameters:
senderAddress - The sender address.

getSubject

public String getSubject()
Get the subject text for this email.

Returns:
The subject text.

setSubject

public void setSubject(String subject)
Set the subject text for this email.

Parameters:
subject - the subject to set

getBody

public String getBody()
Get the body text for this email.

Returns:
The body text.

setBody

public void setBody(String body)
Set the body text for this email.

Parameters:
body - The body text.

getContentType

public String getContentType()
Get the content type for this email.

Returns:
The content type.

setContentType

public void setContentType(String contentType)
Set the content type for this email.

Parameters:
contentType - The content type.

deliverEmail

public String deliverEmail()
Action handler that delivers an email message given the specified data.

Returns:
"error" for failures or "ok" for success

addExtraBodyParts

protected void addExtraBodyParts(MimeMultipart multipart)
                          throws Exception
Subclasses may override to embed images or other attachments in the mime message.

Parameters:
multipart - The mime message.
Throws:
Exception

createBodyDataSource

protected DataSource createBodyDataSource()
Factory method that can be overridden to provide a different implementation.

Returns:
DataSource A new MessageBodyDataSource constructed from the current body and type.