Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

send an HTML formatted email using MFMailComposeViewController

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.

like image 415
abhishek trivedi Avatar asked Jan 19 '10 16:01

abhishek trivedi


2 Answers

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];
like image 152
Felix Lamouroux Avatar answered Nov 15 '22 12:11

Felix Lamouroux


Even if you set isHTML param to YES, your message body can be sent as plain/text if the message body can be represented as such.

In my case adding a link in the message body helped. Bold formatting with tags works too. Tricky!

Tested on iPod 1G 3.1.3.

like image 21
komorian Avatar answered Nov 15 '22 12:11

komorian