Inherits From:
NSObject
Conforms To: NSObject (NSObject)
Declared in: WebObjects/WOMailDelivery.h
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 class method. You cannot create one of your own.
Returns the current application's WOMailDelivery instance. Use this method instead of creating an instance of your own.
Instance Methods
composeEmailFrom:to:cc:subject:component:send:
- (NSString *)composeEmailFrom: (NSString *)sender
to: (NSArray *)destination
cc: (NSArray *)ccAddresses
subject: (NSString *)subject
component: (WOComponent *)aComponent
send: (BOOL)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 YES, the message is sent immediately.
composeEmailFrom:to:cc:subject:plainText:send:
- (NSString *)composeEmailFrom: (NSString *)sender
to: (NSArray *)destination
cc: (NSArray *)ccAddresses
subject: (NSString *)subject
plainText: (NSString *)message
send: (BOOL)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:
- (void)sendEmail: (NSString *)mailString
Sends anEmail, with anEmail being an NSString following the SMTP format.The composeEmailFrom... methods return such NSStrings and this method lets you modify those strings before sending them.