NSMailDelivery and HTML Email
NSMailDelivery and HTML Email
- Subject: NSMailDelivery and HTML Email
- From: Aleks Tucovic <email@hidden>
- Date: Tue, 02 Aug 2005 16:21:50 -0500
I have successfully used the NSMailDelivery to send text/plain and
text/enriched emails but what seems to be lacking is support for text/
html. The message in the example is sent but Content-type always
reverts to text/plain and the email message is displayed as HTML
source. Has anyone had any success with text/html?
NSAttributedString * htmlString = [NSAttributedString alloc];
NSMutableDictionary * headers = [[NSMutableDictionary alloc] init];
[htmlString initWithString: [NSString stringWithContentsOfFile:
@"index.html"]];
[headers setObject: @"email@hidden"
forKey: @"To"];
[headers setObject: @"HTML Email"
forKey: @"Subject"];
[headers setObject: @"Sat, 30 Jul 2005 20:00:00 -0600 (MDT)"
forKey: @"Date"];
[headers setObject: @"text/html"
forKey: @"Content-type"];
BOOL sent = [NSMailDelivery deliverMessage: htmlString
headers: headers
format: NSMIMEMailFormat
protocol: nil];
Aleks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden