• 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
Re: Sending HTML with NSMailDelivery
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sending HTML with NSMailDelivery


  • Subject: Re: Sending HTML with NSMailDelivery
  • From: Scott Anguish <email@hidden>
  • Date: Wed, 24 Sep 2003 02:57:24 -0400

I think what you're seeing here is the level of support that NSAttributedString has for HTML.

I'm guessing you have a table in the HTML, or something that the NSAttributedString is unable to image as HTML.

You might have more success if you attached the HTML content as a file (insert it into the HTML as a text attachment). Mail clients MIGHT accept that and display it by default (big might there BTW).





On Sep 24, 2003, at 1:27 AM, Eric Freeman wrote:

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.
_______________________________________________
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:
    • Setting Alpha of an NSView
      • From: John Pattenden <email@hidden>
References: 
 >Sending HTML with NSMailDelivery (From: Eric Freeman <email@hidden>)

  • Prev by Date: Sending HTML with NSMailDelivery
  • Next by Date: Re: NSMovieView problem
  • Previous by thread: Sending HTML with NSMailDelivery
  • Next by thread: Setting Alpha of an NSView
  • Index(es):
    • Date
    • Thread