HTML letter loses formatting after sending from iPhone program

I use the MFMailComposeViewController in the iPhone SDK to open an email dialog to send an HTML email. The contents of the message body are read from an HTML file that is created in the application and stored in the file system. The email looks great in the mail sending dialog, and all CSS formatting is there. However, after sending the e-mail message to the gmail and hotmail accounts, the e-mail appears in plain text, with all the formatting missing. Mail is sent from my phone using a gmail account.

When I set the message body on the controller, I set isHTML to YES. The content of the html file is very simple; a style block with certain CSS and some text div . The html file contains html , head and body tags (I also tried this without these tags with type onlyand div ).

Any ideas guys? I tried to understand this for almost a day without a break.

Here's the email window that displays the email, correctly formatted before sending: alt text http://img515.imageshack.us/img515/7962/screenshot20091031at114.png

+3
source share
4 answers

Inclusion <STYLE/>in <BODY/>your HTML should do the trick.

+5
source

We had a similar problem. It was not possible to find out who crossed out html and why, but we found that adding a tag <font>(yes, old obsolete) leaves the content type as text / html and includes full formatting.

Can anyone shed more light?

0
source

, STYLE BODY .

0

, CSS .

, , iPhone, CSS. , , CSS .

CSS , style="" .

: http://www.htmlgoodies.com/beyond/css/article.php/3679231/How-to-Create-Great-HTML-Emails-with-CSS.htm http://kb.mailchimp.com/article/top-html-email-coding-mistakes/

0

Source: https://habr.com/ru/post/1721583/


All Articles