iphonecocoauiimagemessageui

MFMessageViewController and inline UIImage


I'm currently composing an HTML-Mail using MFMailComposer. Everything like Background Color etc. is working quite fine, I can even embed images inline which are located under an online URL. But when I want to embed an locally stored UIImage everything is messed up. Therefore I'm converting the data to base64 and use the image-tag as follows

<img src='data:image/png;base64,%@'>

In the preview on the device everything is shown properly, but on my computer in the mail-app there is only the placeholder question mark image, when I view the source of the mail all there seems to be send is

<img src="cid:(null)">

Also I'm able to successfully log the base64 encoded data on the device, it just simply doesn't make it's way to the server or down from there. Attaching the image is not a solution as I NEED the image to be inline and not at the end of the mail :(

UPDATE:

Here's are the lines I use to embed the image into HTML inline:

[body appendFormat:@"<p><b><img src='data:image/png;base64,%@'/></b></p>",[[NSData dataWithData:UIImagePNGRepresentation([dict objectForKey:@"graphImage"])] base64EncodedString]];

Solution

  • It's not possible to embed inline images (I've spend days on the problem).

    Oh, how I wish it were....