开发者

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

开发者 https://www.devze.com 2022-12-28 19:02 出处:网络
I\'m sending mails thanks to the MFMailComposeV开发者_JAVA技巧iewController 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

I'm sending mails thanks to the MFMailComposeV开发者_JAVA技巧iewController 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消