|
WebObjects 5.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.webobjects.appserver.WOMailDelivery
WOMailDelivery constructs an email message from a file and uses Sun's sun.net.smtp package to send it. WOMailDelivery requires an SMTP server to be set. If no value is provided, the default "smtp" is used. Note that this default value can be changed by WOApplication as a command-line argument, or by using the mechanisms supplied by NSProperties.
There is only one instance of WOMailDelivery,
which you access with the sharedInstance
static method.
You cannot create one of your own.
NSProperties
Constructor Summary | |
protected |
WOMailDelivery()
This protected constructor initializes a newly-instantiated WOMailDelivery object. |
Method Summary | |
String |
composeComponentEmail(String aSender,
NSArray somePeople,
NSArray otherPeople,
String aSubject,
WOComponent aComponent,
boolean sendNow)
Composes an email message to somePeople with From, Cc,
and Subject lines, setting the content type of the email as
Content-type: text/html . |
String |
composePlainTextEmail(String aSender,
NSArray somePeople,
NSArray otherPeople,
String aSubject,
String aMessage,
boolean sendNow)
Composes an email message to somePeople with From, Cc,
and Subject lines. |
void |
sendEmail(String mailString)
Sends mailString , with mailString being a String conforming to the
SMTP format. |
static WOMailDelivery |
sharedInstance()
Returns the shared instance of WOMailDelivery that all classes should use. |
String |
toString()
Returns a String representation of the WOMailDelivery object containing the receiver's class name and the SMTP host name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected WOMailDelivery()
sharedInstance
class method.sharedInstance()
Method Detail |
public String composeComponentEmail(String aSender, NSArray somePeople, NSArray otherPeople, String aSubject, WOComponent aComponent, boolean sendNow)
somePeople
with From, Cc,
and Subject lines, setting the content type of the email as
Content-type: text/html
.
The body of the message is the HTML generated when this method invokes
generateResponse
on aComponent
. WOMailDelivery
uses the WOCGIAdaptorURL
default to complete all URLs in
the message to be mailed, so the email's recipient can click on the URLs
to visit them. If sendNow
is true
, the message is sent immediately.
Because sun.net.smtp does not support Cc headers, addresses in the
otherPeople
NSArray are added to the To recipients. The
Cc header is added anyway for the mail recipient's information.
aSender
- String corresponding to the Sender of the mailsomePeople
- NSArray of addresses in the To listotherPeople
- NSArray of addresses in the Cc listaSubject
- String corresponding to the Subject of the mailaComponent
- the current componentsendNow
- boolean flag indicating whether the mail to be sent immediatelyWOApplication.cgiAdaptorURL()
public String composePlainTextEmail(String aSender, NSArray somePeople, NSArray otherPeople, String aSubject, String aMessage, boolean sendNow)
somePeople
with From, Cc,
and Subject lines. If sendNow
is true, the
message is sent immediately.
Because sun.net.smtp does not support Cc headers, addresses in the
otherPeople
NSArray are added to the To recipients. The
Cc header is added anyway for the mail recipient's information.
aSender
- String corresponding to the Sender of the mailsomePeople
- NSArray of addresses in the To listotherPeople
- NSArray of addresses in the Cc listaSubject
- String corresponding to the Subject of the mailaMessage
- String message body using ASCII characterssendNow
- boolean flag indicating whether the mail is to be sent immediatelypublic void sendEmail(String mailString)
mailString
, with mailString
being a String conforming to the
SMTP format. The compose...Email
methods return such Strings. Calling these methods
with sendNow
set to false
allows the caller to modify the returned
String before using this method to send it.mailString
- composed mail message as a String in SMTP format.public static WOMailDelivery sharedInstance()
public String toString()
toString
in class Object
|
Last updated Fri Feb 21 13:15:00 PST 2003. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |