views:

51

answers:

1

In the app I'm currently writing I'd like to populate the message body of an e-mail with a combination of text and images. It took me forever to find out that in order to get an embedded image, you had to have bold tags in the message body (...uhhh, yeah), otherwise the image just shows up as an attachment. But now I have the problem that all of the images just go to the end of the body, and I can't programmatically put text after or in between any of the attachments.

So far I've tried:

  1. Adding images as part of the body string using img tags and a base64 string. This would have worked, but most e-mail clients reject images embedded in this manner.

  2. Using normal img tags with a references to the attached files, using the assigned filenames. Didn't work at all.

  3. Attaching images normally, but also attaching blocks of text to the e-mail. The text is not embedded in the same manner as the images. Turns out to be an attached txt file on the receiving end.

Apple has restricted their MFMailComposieViewController class to the point of ridiculousness, but I know there has to be a way to do this, because they add in their stupid "Sent from my *apple device name here*" message at the end of every e-mail.

So does anyone have any ideas?

A: 

It takes your HTML message (everything between body tags, or so) and sticks it in a div. Image attachments are then referenced using img tags with "cid" URIs. After that, it adds the signature in another div. I don't think there's a way around this; I tried for a while.

I haven't tried adding more text/html attachments; maybe that'll work...

tc.
I tried adding some text/html attachments. They showed up as little html file icons in the app and attached html files for the recipient. The same thing happened with text/plain attachments (except it was an attached text file).
eOgas