ERWOMailDelivery Class Reference

Collaboration diagram for ERWOMailDelivery:

Collaboration graph
[legend]

List of all members.

Classes

class  MimeMessageMailDelivery

Public Member Functions

String composeComponentEmail (String fromEmailAddress, NSArray toEmailAddresses, NSArray bccEmailAddresses, String subject, WOComponent component, boolean sendNow)
String composePlainTextEmail (String fromEmailAddress, NSArray toEmailAddresses, NSArray bccEmailAddresses, String subject, String message, boolean sendNow)
void sendEmail (String mailString)
String toString ()

Static Public Member Functions

static ERWOMailDelivery sharedInstance ()

Protected Member Functions

 ERWOMailDelivery ()

Private Member Functions

MimeMessage newMimeMessage (String fromEmailAddress, NSArray toEmailAddresses, NSArray bccEmailAddresses, String subject, String message, String contentType, boolean sendNow)

Static Private Member Functions

static String mimeMessageToString (MimeMessage smtpMessage)

Static Private Attributes

static ERWOMailDelivery _sharedInstance = null
static Logger log = Logger.getLogger(ERWOMailDelivery.class)


Detailed Description

Drop-in replacement for WOMailDelivery.

ERWOMailDelivery operates just the same as WOMailDelivery, and has all of the same limitations and weird API. However, instead of using the Sun's broken* and unsupported sun.net.smtp.SmtpClient, it uses JavaMail.

*sun.net.smtp.SmtpClient doesn't put addresses in angle brackets when sending the SMTP MAIL FROM command. Many SMTP servers won't work with it.

Author:
Jonathan 'Wolf' Rentzsch (jon at redshed dot net)
See also:
com.webobjects.appserver.WOMailDelivery

Constructor & Destructor Documentation

ERWOMailDelivery (  )  [protected]

Default constructor (don't use). Use sharedInstance() instead.


Member Function Documentation

String composeComponentEmail ( String  fromEmailAddress,
NSArray  toEmailAddresses,
NSArray  bccEmailAddresses,
String  subject,
WOComponent  component,
boolean  sendNow 
)

Creates and optionally sends a WOComponent as email.

Parameters:
fromEmailAddress Originating email address. Required.
toEmailAddresses Destination email address. Required.
bccEmailAddresses Array of Strings containing additional addressed to BCC. Null OK.
subject Subject the the message. Null OK.
component Body the the message. Required.
sendNow Whether to send the message right away. If you're going to send the message right away, it's faster to set sendNow to true than set it to false and calling sendEmail(String) later.

String composePlainTextEmail ( String  fromEmailAddress,
NSArray  toEmailAddresses,
NSArray  bccEmailAddresses,
String  subject,
String  message,
boolean  sendNow 
)

Creates and optionally sends a plain text email.

Parameters:
fromEmailAddress Originating email address. Required.
toEmailAddresses Destination email address. Required.
bccEmailAddresses Array of Strings containing additional addressed to BCC. Null OK.
subject Subject the the message. Null OK.
message Body the the message. Required.
sendNow Whether to send the message right away. If you're going to send the message right away, it's faster to set sendNow to true than set it to false and calling sendEmail(String) later.

static String mimeMessageToString ( MimeMessage  smtpMessage  )  [static, private]

MimeMessage newMimeMessage ( String  fromEmailAddress,
NSArray  toEmailAddresses,
NSArray  bccEmailAddresses,
String  subject,
String  message,
String  contentType,
boolean  sendNow 
) [private]

void sendEmail ( String  mailString  ) 

Sends the RFC822 mail string created with either composePlainTextEmail(String,NSArray,NSArray,String,String,boolean) or composeComponentEmail(String,NSArray,NSArray,String,WOComponent,boolean). It's faster to call either method with the sendNow parameter set to true than to use this method.

static ERWOMailDelivery sharedInstance (  )  [static]

Returns:
The shared instance.

String toString (  ) 


Member Data Documentation

ERWOMailDelivery _sharedInstance = null [static, private]

Logger log = Logger.getLogger(ERWOMailDelivery.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