How to embed UIImage into email with html content?

I am sending emails via the MFMailComposeViewController API and I manage to add uiimages in the application, but I would like to embed my uiimage in html code in my email, any idea on what transform I should use for my image?

Thanks.

+2


a source to share


1 answer


First convert the image to PNG ( UIImagePNGRepresentation

) or JPEG ( UIImageJPEGRepresentation

) data.

Then call -addAttachmentData:mimeType:fileName:

on the mail viewer controller with PNG / JPEG data.



Your image will be shown as an attachment.

+1


a source







All Articles