Documentation Archive Developer
Search
PATH Documentation > WebObjects

Table of Contents

WOMailDelivery


Inherits from:
Object
Package:
com.webobjects.appserver


Class Description


WOMailDelivery uses a tool compiled on all platforms: /System/Library/WebObjects/Executables/WOSendMail[.exe]. This tool constructs an Email message from a file and uses SMTP to send it. It requires an SMTP server to be set. There is a default value for this SMTP hostname: "smtp". To change this value, use the following command:

defaults write NSGlobalDomain WOSMTPHost "aHostName"

Note that this default can be handled by WOApplication as a command-line argument.

There is only one instance of WOMailDelivery, which you access with the sharedInstance static. You cannot create one of your own.




Method Types


Obtaining an instance
sharedInstance
Composing mail
composeComponentEmail
composePlainTextEmail
Sending mail
sendEmail


Constructors



WOMailDelivery

protected WOMailDelivery()

This protected constructor initializes a newly-instantiated WOMailDelivery object. WebObjects applications shouldn't allocate WOMailDelivery objects, but instead should make use of the shared instance provided by WOMailDelivery's sharedInstance() class method.


Static Methods



sharedInstance

public static WOMailDelivery sharedInstance()

Returns the current application's WOMailDelivery instance. Use this method instead of creating an instance of your own.


Instance Methods



composeComponentEmail

public String composeComponentEmail( String sender, NSArray destination, NSArray ccAddresses, String subject, WOComponent aComponent, boolean flag)

Composes an email message to destination with "from," "cc," and "subject" lines. 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 reader can click on the URLs to visit them.

If flag is true, the message is sent immediately.



composePlainTextEmail

public String composePlainTextEmail( String sender, NSArray destination, NSArray ccAddresses, String subject, String message, boolean flag)

Composes an email message to destination with "from," "cc," and "subject" lines, setting the content type of the email as (Content-type: TEXT/PLAIN; CHARSET=US-ASCII). If flag is YES, the message is sent immediately.

sendEmail

public void sendEmail(String mailString)

Sends anEmail, with anEmail being a String following the SMTP format.The compose...Email methods return such Strings and this method lets you modify those strings before sending them.

toString

public String toString()

Returns a String representation of the WOMailDelivery object containing the receiver's class name and the SMTP host name.

© 2001 Apple Computer, Inc. (Last Published April 15, 2001)


Table of Contents