Apple Developer Connection
Advanced Search
Member Login Log In | Not a Member? Contact ADC
ADC Home > Reference Library > Reference > Apple Applications > Mail > Message Framework Reference

 


NSMailDelivery

Inherits from:
Declared In:

Overview

class to enable delivery of an email message using Mail.

Discussion

The NSMailDelivery class enables applications to send email messages using Mail. It includes the ability to send both plain text and MIME-encapsulated email messages through deliverMessage:headers:format:protocol:, and also provides a simplified interface, deliverMessage:subject:to:, for delivering basic messages easily.

Availability
Introduced in Mac OS X v10.0, but later deprecated in Mac OS X v10.5.


Methods

+deliverMessage:headers:format:protocol:
Deliver a message.
+deliverMessage:subject:to:
Deliver a message (basic)
+hasDeliveryClassBeenConfigured
Have delivery accounts have been configured?

deliverMessage:headers:format:protocol:


Deliver a message.

+ (BOOL)deliverMessage: (NSAttributedString *)messageBody 
        headers: (NSDictionary *)messageHeaders format: (NSString *)messageFormat 
        protocol: (NSString *)deliveryProtocol; 
Parameters
messageBody
the actual contents of the message. If messageFormat is NSASCIIMailFormat, any rich text or attachments in messageBody will be lost.
messageHeaders
contains all of the values that will appear in the message header, for example, "To", "From", "Subject", etc. If the value is an array, the elements in the array will converted to a comma seperated list of values in the message header
messageFormat
can be either NSASCIIMailFormat or NSMIMEMailFormat
deliveryProtocol
can be NSSMTPDeliveryProtocol or nil to use the platform's default deliveryProtocol (this is the preferred choice).
Discussion

deliverMessage:headers:format:protocol: is used to deliver a message vie email. It may be MIME-encoded or plain text, but requires all header fields to be specified.

For a simpler (but less flexible) interface, see deliverMessage:subject:to:.

Availability
Introduced in Mac OS X v10.0, but later deprecated in Mac OS X v10.5.

deliverMessage:subject:to:


Deliver a message (basic)

+ (BOOL)deliverMessage:(NSString *)messageBody subject:(NSString *)messageSubject 
        to:(NSString *)destinationAddress; 
Parameters
messageBody
is the plain text contents of the message
messageSubject
is the subject of the message
destinationAddress
is the recipient's email address, e.g. johndoe@apple.com
Discussion

deliverMessage:subject:to: is a method for delivering basic messages via email. For more complex requirements (such as MIME), see deliverMessage:headers:format:protocol:.

Availability
Introduced in Mac OS X v10.0, but later deprecated in Mac OS X v10.5.

hasDeliveryClassBeenConfigured


Have delivery accounts have been configured?

+ (BOOL)hasDeliveryClassBeenConfigured; 
Discussion

hasDeliveryClassBeenConfigured returns YES/NO according to whether delivery accounts have been configured.

Availability
Introduced in Mac OS X v10.0, but later deprecated in Mac OS X v10.5.




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Last Updated: 2008-03-11