Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIActivityViewController send html mail ios6

I am using UIActivityViewController with my iphone application to share a picture and a text.

I use this tutorial to custom the text for the differents services :

https://www.albertopasca.it/whiletrue/objective-c-custom-uiactivityviewcontroller-icons-and-text/

every thing is perfect but I need html to format the mail.

I don't find any way to format the code with html, I have html tag...

is there a way to send mail via UIActivityViewController with html format? I don't want plain text

like image 657
amau96 Avatar asked Nov 05 '12 14:11

amau96


1 Answers

If you return NSString containing HTML then com.apple.UIKit.activity.Mail will interpret it as HTML.

NSString *body = @"<html><body><ul><li>one</li><li>two</li></ul></body></html>";

If you want to have HTML email body and plain text Twitter tweets then create a new class adopting the UIActivityItemSource protocol and implement activityViewController:itemForActivityType:

like image 191
tomi44g Avatar answered Oct 20 '22 19:10

tomi44g