ERMailDelivery Class Reference

Inherited by ERMailDeliveryComponentBased, ERMailDeliveryPlainText, and ERWOMailDelivery.MimeMessageMailDelivery.

Collaboration diagram for ERMailDelivery:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void addAttachment (ERMailAttachment attachment)
void addInlineAttachment (ERMailAttachment attachment)
NSArray< ERMailAttachmentattachments ()
String charset ()
String contextString ()
 ERMailDelivery ()
 ERMailDelivery (javax.mail.Session session)
NSArray< ERMailAttachmentinlineAttachments ()
void newMail ()
void removeAttachment (ERMailAttachment attachment)
void sendMail (boolean shouldBlock)
void sendMail ()
void setAdditionalHeader (String headerKey, String value) throws MessagingException
void setBCCAddresses (NSDictionary< String, String > bccAddresses) throws MessagingException, AddressException
void setBCCAddresses (NSArray< String > bccAddresses) throws MessagingException, AddressException
void setCCAddresses (NSDictionary< String, String > ccAddresses) throws MessagingException, AddressException
void setCCAddresses (NSArray< String > ccAddresses) throws MessagingException, AddressException
void setCharset (String charset)
void setContextString (String contextString)
void setDelegate (ERMessage.Delegate delegate)
void setFromAddress (String fromAddress, String personalName) throws MessagingException, AddressException
void setFromAddress (String fromAddress) throws MessagingException, AddressException
void setInternetAddresses (NSArray< InternetAddress > addresses, Message.RecipientType type) throws MessagingException
void setReplyToAddress (String toAddress, String personalName) throws MessagingException, AddressException
void setReplyToAddress (String toAddress) throws MessagingException, AddressException
void setSubject (String subject) throws MessagingException
void setToAddress (String toAddress, String personalName) throws MessagingException, AddressException
void setToAddress (String toAddress) throws MessagingException, AddressException
void setToAddresses (NSDictionary< String, String > toAddresses) throws MessagingException, AddressException
void setToAddresses (NSArray< String > toAddresses) throws MessagingException, AddressException
void setUserInfo (NSDictionary< String, Object > userInfo)
void setXMailerHeader (String xMailer) throws MessagingException
NSDictionary< String, Object > userInfo ()
String xMailerHeader () throws MessagingException

Public Attributes

String _charset = DefaultCharset

Static Public Attributes

static final String DefaultCharset = System.getProperty("er.javamail.defaultEncoding")

Protected Member Functions

NSMutableArray< ERMailAttachment_attachments ()
NSMutableArray< ERMailAttachment_inlineAttachments ()
ERMessage buildMessage ()
void finishMessagePreparation () throws MessagingException
InternetAddress internetAddressWithEmailAndPersonal (String email, String personal) throws AddressException
MimeMessage mimeMessage ()
abstract DataHandler prepareMail () throws MessagingException
javax.mail.Session session ()
void setMimeMessage (MimeMessage message)
void setSession (javax.mail.Session aSession)

Protected Attributes

NSMutableArray< ERMailAttachment_attachments
NSMutableArray< ERMailAttachment_inlineAttachments
MimeMessage _mimeMessage

Private Member Functions

void setAddresses (NSDictionary< String, String > addressesDictionary, Message.RecipientType type, boolean filterAddresses) throws MessagingException, AddressException
void setAddresses (NSArray< String > addressesArray, Message.RecipientType type, boolean filterAddresses) throws MessagingException, AddressException

Private Attributes

String _contextString
ERMessage.Delegate _delegate
javax.mail.Session _session
NSDictionary< String, Object > _userInfo

Static Private Attributes

static final Logger log = Logger.getLogger(ERMailDelivery.class)


Constructor & Destructor Documentation

ERMailDelivery ( javax.mail.Session  session  ) 

Designated constructor

ERMailDelivery (  ) 

Default constructor


Member Function Documentation

void addAttachment ( ERMailAttachment  attachment  ) 

void addInlineAttachment ( ERMailAttachment  attachment  ) 

NSArray<ERMailAttachment> attachments (  ) 

ERMessage buildMessage (  )  [protected]

Builds an ERMessage for the current MimeMessage.

Returns:
ERMessage for the current MimeMessage.

String charset (  ) 

String contextString (  ) 

void finishMessagePreparation (  )  throws MessagingException [protected]

NSArray<ERMailAttachment> inlineAttachments (  ) 

InternetAddress internetAddressWithEmailAndPersonal ( String  email,
String  personal 
) throws AddressException [protected]

MimeMessage mimeMessage (  )  [protected]

void newMail (  ) 

Creates a new mail instance within ERMailDelivery

Reimplemented in ERMailDeliveryHTML.

abstract DataHandler prepareMail (  )  throws MessagingException [protected, pure virtual]

Abstract method called by subclasses for doing pre-processing before sending the mail.

Returns:
the multipart used to put in the mail.

Implemented in ERMailDeliveryHTML, ERMailDeliveryPlainText, ERMailDeliveryWOComponentPlainText, and ERWOMailDelivery.MimeMessageMailDelivery.

void removeAttachment ( ERMailAttachment  attachment  ) 

void sendMail ( boolean  shouldBlock  ) 

Method used to construct a MimeMessage and then send it. This method can be specified to block until the message is sent or to add the message to a queue and have a callback object handle any exceptions that happen. If sending is blocking then any exception thrown will be wrapped in a general NSForwardException.

Parameters:
shouldBlock boolean to indicate if the message should be added to a queue or sent directly.

void sendMail (  ) 

Sends the mail immediately. The message is put in a FIFO queue managed by a static threaded inner class

javax.mail.Session session (  )  [protected]

void setAdditionalHeader ( String  headerKey,
String  value 
) throws MessagingException

Sets an additional custom header element for the message.

Parameters:
header header key
value value to set

void setAddresses ( NSDictionary< String, String addressesDictionary,
Message.RecipientType  type,
boolean  filterAddresses 
) throws MessagingException, AddressException [private]

Sets addresses regarding their recipient type in the current message. Has the option to filter the address list based on the white and black lists.

void setAddresses ( NSArray< String addressesArray,
Message.RecipientType  type,
boolean  filterAddresses 
) throws MessagingException, AddressException [private]

Sets addresses regarding their recipient type in the current message. Has the option to filter the address list based on the white and black lists.

void setBCCAddresses ( NSDictionary< String, String bccAddresses  )  throws MessagingException, AddressException

Sets the bcc-addresses array for the current message instance

void setBCCAddresses ( NSArray< String bccAddresses  )  throws MessagingException, AddressException

Sets the bcc-addresses array for the current message instance

void setCCAddresses ( NSDictionary< String, String ccAddresses  )  throws MessagingException, AddressException

Sets the cc-addresses array for the current message instance

void setCCAddresses ( NSArray< String ccAddresses  )  throws MessagingException, AddressException

Sets the cc-addresses array for the current message instance

void setCharset ( String  charset  ) 

void setContextString ( String  contextString  ) 

void setDelegate ( ERMessage.Delegate  delegate  ) 

Sets the given delegate to listen to any messages that are created from this ERMailDelivery. This will automatically call ERMessage.setDelegate(delegate) for any ERMessage that is generated.

Parameters:
delegate the delegate to use for notifications

void setFromAddress ( String  fromAddress,
String  personalName 
) throws MessagingException, AddressException

Sets the from address for the current message instance using an email and the personal name.

void setFromAddress ( String  fromAddress  )  throws MessagingException, AddressException

Sets the from address for the current message instance

void setInternetAddresses ( NSArray< InternetAddress >  addresses,
Message.RecipientType  type 
) throws MessagingException

Sets addresses using an NSArray of InternetAddress objects.

void setMimeMessage ( MimeMessage  message  )  [protected]

void setReplyToAddress ( String  toAddress,
String  personalName 
) throws MessagingException, AddressException

Sets the reply-to address for the current message instance

void setReplyToAddress ( String  toAddress  )  throws MessagingException, AddressException

Sets the reply-to address for the current message instance

void setSession ( javax.mail.Session  aSession  )  [protected]

void setSubject ( String  subject  )  throws MessagingException

Sets the subject for the current message instance

void setToAddress ( String  toAddress,
String  personalName 
) throws MessagingException, AddressException

Sets the to address for the current message instance using an email and the personal name.

void setToAddress ( String  toAddress  )  throws MessagingException, AddressException

void setToAddresses ( NSDictionary< String, String toAddresses  )  throws MessagingException, AddressException

Sets the to-addresses array for the current message instance

void setToAddresses ( NSArray< String toAddresses  )  throws MessagingException, AddressException

Sets the to-addresses array for the current message instance

void setUserInfo ( NSDictionary< String, Object >  userInfo  ) 

Sets the userInfo dictionary for this ERMailDelivery. This userInfo is passed through to any ERMessage that is created by this ERMailDelivery, which can be used by delegates to get additional information about the message.

Parameters:
userInfo the userInfo dictionary

void setXMailerHeader ( String  xMailer  )  throws MessagingException

Sets the X-Mailer header for the message. Useful for tracking which mailers are sending messages.

Parameters:
xMailer value to set

NSDictionary<String, Object> userInfo (  ) 

Returns the userInfo dictionary for this ERMailDelivery.

Returns:
the userInfo dictionary

String xMailerHeader (  )  throws MessagingException

Gets the X-Mailer header set on the MimeMessage.

Returns:
X-Mailer header if it is set


Member Data Documentation

NSArray of ERMailAttachment that must be binded to the message as ATTACHEMENT.

ERMessage.Delegate _delegate [private]

NSArray of ERMailAttachment that must be binded to the message as INLINE.

MimeMessage _mimeMessage [protected]

Content of sent mail. In one instance of ERMailDelivery, when creating multiple mails, you must be sure to call newMail () method before send a new mail in order to have a cleared fresh mail

javax.mail.Session _session [private]

JavaMail session

NSDictionary<String, Object> _userInfo [private]

final String DefaultCharset = System.getProperty("er.javamail.defaultEncoding") [static]

final Logger log = Logger.getLogger(ERMailDelivery.class) [static, private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:22 2012 for Project Wonder by  doxygen 1.5.8