send an HTML formatted email using MFMailComposeViewController

前端 未结 2 500
[愿得一人]
[愿得一人] 2020-12-30 14:48

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 vis

相关标签:
2条回答
  • 2020-12-30 15:29

    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];
    
    0 讨论(0)
  • 2020-12-30 15:37

    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.

    0 讨论(0)
提交回复
热议问题