Search code examples
objective-ciosxcodemfmailcomposer

mfmailcomposer cuts end of html email


I've created an in app email feature to ask a question that opens the mfmailcomposer and fills it with html content. Unfortunately it seems to cut off the final line of the email so it appears as the image below.

Here's an example

I have set the mfmailcomposer to self, followed every tutorial I can find, the only reference to fix it has said the following:

  1. make sure your mfmailcomposer is set to self ie. [self presentModalViewController:email animated:YES];
  2. make sure it's embedded within a navigation controller

Neither solution works.

I have found that if the email contents is short enough that the entire email fits on screen the problem doesn't appear but if you continue typing to push the contents off the edge it reappears.

Any ideas on a solution? Or is this an Apple xcode "design feature"?


Solution

  • I managed to resolve this issue, it seems to be a bug, that's the only explanation I can reach.

    If the start of your content is a header (<h1>, <h2>, <h3>, etc) tag (even if it is within a HTML and BODY tag) it creates this issue.

    If you want to start your email body with a header tag then the simplest way of fixing it is to add a non breaking spacer before the header tag, it seems to completely resolve the issue.