问题
I am sending HTML
in mail using MFMailCompose.
This HTML
includes strings and images.
So when I use to send this mail, It is sending text only. It does not display any images.
How can I send my all HTML
data So that images are shown in email ?
回答1:
You can have inline images in HTML but you have to encode the attachments data using base64 encoding. This leads to problems with some email clients e.g. Gmail. Please find a detailed discussion on this issue here: How to add a UIImage in MailComposer Sheet of MFMailComposeViewController
回答2:
To my knowledge you cannot embed images into the HTML body of a message (though you can, of course, embed references to images located elsewhere on the net). Images attached to the HTML message (using the mail composer's function for adding attachments) will generally (with most mail readers) be displayed following the message in a fairly "attractive" format. (Note that you don't get this nice formatting if the message itself is not HTML.)
回答3:
I am working on doing the same thing, i.e. trying to embed an image into an email message. I just came across the following post http://davidjhinson.wordpress.com/2009/01/21/embedding-images-in-outbound-email-using-cocoa-touch/ that looks promising. I have not tried this yet but will do so later this week. If you try this yourself, let us know if it worked for you.
来源:https://stackoverflow.com/questions/6561607/iphone-problem-while-sending-image-and-text-in-html-formate-using-mfmailcompos