• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Sending HTML with NSMailDelivery
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Sending HTML with NSMailDelivery
      • From: Scott Anguish <email@hidden>
  • Prev by Date: Re: Silly question: Company name
  • Next by Date: Re: Sending HTML with NSMailDelivery
  • Previous by thread: Re: NSTextFieldCell subclass
  • Next by thread: Re: Sending HTML with NSMailDelivery
  • Index(es):
    • Date
    • Thread