views:

61

answers:

1

Hi,

I'm sending mails thanks to the MFMailComposeViewController API, and I manage to add uiimages in attachment, but I'd like to insert my uiimage into html code in my e-mail, any idea of what kind of conversion I should use for my image ?

Thanks.

+1  A: 

First, convert the image into PNG (UIImagePNGRepresentation) or JPEG (UIImageJPEGRepresentation) data.

Then, call -addAttachmentData:mimeType:fileName: on the mail compose view controller with that PNG/JPEG data.

Your image will be shown as an attachment.

KennyTM
Yes, that's what I'm doing now, but actually I would like to have my image directly in html code inside the body of the mail, not as an attachment...
Yoot
@Yoot: Unfortunately, there's no documented way to get the Content-ID of that attached image. Maybe you could try `data:` URI scheme...
KennyTM