HTML email message body with UIActivityViewController

Without subclassing UIActivity, is it possible to use UIActivityViewController (UIActivityTypeMessage) to share a html message via the Mail app?

When I passed the HTML as NSString, the body shows the html tags (eg ) in the message body which is not what I want.


Make sure the string you pass into the activity includes <html . UIKit's internal UIMailActivity class explicitly checks for the presence of <html to determine if the message is HTML or plain text.

[r12 rangeOfString:@"<html" options:NSCaseInsensitiveSearch range:0x0];

Note that while UIActivity is documented that it can send HTML messages, this exact trigger mechanism isn't part of the API contract. Technically, it could break in future versions.

链接地址: http://www.djcxy.com/p/94634.html

上一篇: UIActivityViewController或UIDocumentInteractionController与WhatsApp和FB

下一篇: HTML电子邮件正文与UIActivityViewController