简体   繁体   中英

How to insert a UIImage into an e-mail with html content?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM