send an HTML formatted email using MFMailComposeViewController

abhishek trivedi picture abhishek trivedi · Jan 19, 2010 · Viewed 7.7k times · Source

I am formatting a mail with HTML content and sending it using MFMailComposeViewController.But on the receiver side mail is not reaching in HTML format.Only Plain text is visible.How could I resolve this issue.Thanks in advance.

Answer

Felix Lamouroux picture Felix Lamouroux · Jan 19, 2010

Be sure to set the message body using the following lines:

MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
NSString *emailBody = @"<p><b>Hello World</b></p>";                         
[picker setMessageBody:emailBody isHTML:YES];