Is it possible to embed an inline image in an HTML email address using MFMailComposeViewController?

Can I embed a link to an image in an HTML email sent via MFMailComposeViewController on iPhone OS 3.0?

(void)addAttachmentData:(NSData*)attachment mimeType:(NSString*)mimeType fileName:(NSString*)filename 

It doesn't seem to provide any way to configure or read the Content-ID header for the attachment, but is there any way to make this work?

I saw applications that do this, but they probably use SKPSMTPMessage ...

+1
source share
1 answer

I believe you can use the HTML tag in the body of the letter to achieve what you are looking for. This is not a common occurrence, but the img src attribute can indeed be set to base-64 encoded image data. For example, you can say "<img src='data:image/gif;base64,R0lGODlhUAAPAKIA......'>" and paste the image data into a string.

Here is an article with additional information: https://web.archive.org/web/20140819061025/http://www.sweeting.org/mark/blog/2005/07/12/base64-encoded-images-embedded-in- html

I know this works in Mobile Safari, but I never used it in Mail. This seems to work - I'm sure they use WebKit to render HTML email messages.

Good luck

+5
source

All Articles