Project Wonder 2.0

er.javamail
Class ERWOMailDelivery

java.lang.Object
  extended byer.javamail.ERWOMailDelivery

public class ERWOMailDelivery
extends Object

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 Summary
protected ERWOMailDelivery()
          Default constructor (don't use).
 
Method Summary
 String composeComponentEmail(String fromEmailAddress, NSArray toEmailAddresses, NSArray bccEmailAddresses, String subject, WOComponent component, boolean sendNow)
          Creates and optionally sends a WOComponent as email.
 String composePlainTextEmail(String fromEmailAddress, NSArray toEmailAddresses, NSArray bccEmailAddresses, String subject, String message, boolean sendNow)
          Creates and optionally sends a plain text email.
 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).
static ERWOMailDelivery sharedInstance()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ERWOMailDelivery

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

Method Detail

sharedInstance

public static ERWOMailDelivery sharedInstance()
Returns:
The shared instance.

composePlainTextEmail

public 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.
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.

composeComponentEmail

public 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.
bccEmailAddresses - Array of Strings containing additional addressed to BCC. Null OK.
subject - Subject the the message. Null OK.
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.

sendEmail

public 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.


toString

public String toString()

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.