Sending HTML with NSMailDelivery
Sending HTML with NSMailDelivery
- Subject: Sending HTML with NSMailDelivery
- From: Eric Freeman <email@hidden>
- Date: Tue, 23 Sep 2003 22:27:47 -0700
I think I've pretty thoroughly looked through the list archives and
haven't seen this specific issue discussed with respect to the
NSMailDelivery framework: I'm trying to send a simple HTML-based email,
and using the code below (also derived from this list), I end up
generating an email with a tiff attachment rather than html. What I
want is a multipart message with actual HTML in it, not a tiff version.
...
NSString *html = [self html];
NSAttributedString *theMessage = [[[NSAttributedString alloc]
initWithHTML:[NSData dataWithBytes:[html cString]
length:[html length]]
documentAttributes:nil] autorelease];
[headersDict setObject:@"<to email here>" forKey:@"To"];
[headersDict setObject:@"Subject" forKey:@"Subject"];
result=[NSMailDelivery deliverMessage:theMessage
headers:headersDict
format:NSMIMEMailFormat
protocol:nil];
Any ideas?
Thanks,
Eric
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.