HTML sformatowany e-mail nie pojawia się w ogóle w Gmailu, ale jest w innych klientach pocztowych

Obecnie wysyłam e-maile w formacie html z funkcji mail () PHP i sprawdzam je po prostu, aby upewnić się, że wyświetlają się jako HTML (pomijając formatowanie, jestem świadomy, że formatowanie będzie się różnić (prawdopodobnie drastycznie) od klienta do klienta). Są one wyświetlane jako HTML w kliencie Apple Mail, a także na moim iPhonie. Jednak Gmail po prostu odmawia wyświetlania go jako HTML, jak wszystkie. I przez to nie mam na myśli, że jest sformatowany nieprawidłowo, po prostu nie używa HTML pojawia się.

Najdziwniejsze jest to, że img z tagu jest ładowany, ale to wszystko... czy to, że używam głównie div do layoutu i to jest zbyt nowe dla Gmaila czy coś (vs tabele)?

Jeśli chodzi o CSS i co nie idzie, przeglądanie surowego źródła pokazuje co następuje:

<html><head><style>body { background-color: #F2F2F2; font-family: Arial; color: #5C5C5C; font-size: 11pt; } a { color: #46AAFF; text-decoration: none; } #container { width: 750px; margin-right: auto; margin-left: auto; } #header { float: right; padding: 3px; height: 30px; } #header a { color: #666666; margin-right: 10px; } #mainBody { padding: 20px; background-color: #FFF; border: 1px solid #DADADA; border-radius: 3px; } #imageArea { border-top: solid #E8E8E8 1px; margin: 15px; } #singleImageArea { width: 250px; padding: 15px; } #singleImageArea p { float: right; line-height: 30px; width: 130px; margin-top: 20px; } #footer { padding: 10px; color: gray; } #footer p { text-shadow: 0px 2px #FFF; font-size: 10pt; } #footer a { color: #ADADAD; float: right; padding-left: 20px; padding-right: 20px; } #footer img { width: 35px; height: 23px; padding: 10px; float: left; } </style></head><body><div id="container"><div id="header"><a href="http://appname.local/login/">Login</a></d
 iv><div style="clear: both;"></div><div id="mainBody"><h1>Hi Josh Holat!</h1>You've sent a request to <strong>reset</strong> your appname password. Just click the link below <em>(or copy and paste it into your browser)</em> and follow the instructions to set a new password. The link will expire in one hour.<br/><br/><a href="http://appname.local/sb/reset-password/?r=2768af61698fcde9c04f9449351575d6bfe6d720">http://appname.local/sb/reset-password/?r=2768af61698fcde9c04f9449351575d6bfe6d720</a><br/><br/>If you feel this request was submitted in error, don't worry; you can safely ignore this e-mail and your password will not be changed.<br/><br/>Much Love,<br/>Us</div><!-- #mainBody --><div id="footer"><img src="http://appname.local/images/email/footer_sb.png" /><p>&copy; 2011 appname, Inc. All Rights Reserved <a href="http://appname.local/sb/legal/">Legal</a><a href="http://appname.local/sb/contact/">Contact</a><a href="http://s
 tagebloc.local/sb/developers/">Developers</a><a href="http://appname.local/sb/blog/">Blog</a></p></div><!-- #footer --></div><!-- #container --></body></html>

Oraz:

    Delivered-To: [email protected]
Received: by 10.229.40.2 with SMTP id i2cs133298qce;
        Sun, 28 Aug 2011 14:29:08 -0700 (PDT)
Received: by 10.42.152.199 with SMTP id j7mr4419937icw.417.1314566947950;
        Sun, 28 Aug 2011 14:29:07 -0700 (PDT)
Return-Path: <[email protected]>
Received: from joshholat.local (arh2281.urh.uiuc.edu [130.126.70.193])
        by mx.google.com with ESMTP id w3si6800550icz.109.2011.08.28.14.29.06;
        Sun, 28 Aug 2011 14:29:06 -0700 (PDT)
Received-SPF: neutral (google.com: 130.126.70.193 is neither permitted nor denied by best guess record for domain of [email protected]) client-ip=130.126.70.193;
Authentication-Results: mx.google.com; spf=neutral (google.com: 130.126.70.193 is neither permitted nor denied by best guess record for domain of [email protected]) [email protected]
Received: by joshholat.local (Postfix, from userid 70)
    id 775063662E01; Sun, 28 Aug 2011 16:29:06 -0500 (CDT)
To: Josh Holat <[email protected]>
Subject: Password Reset Request
X-PHP-Originating-Script: 501:Email.php
From: appname <[email protected]>
Content-type: text/html
Message-Id: <[email protected]>
Date: Sun, 28 Aug 2011 16:29:06 -0500 (CDT)

Jestem zdezorientowany, dlaczego klienci innych firm pokazaliby to dobrze, ale Gmail po prostu to zignorował?

Author: joshholat, 2011-08-29

3 answers

Gmail nie obsługuje tagu <style>. Aby gmail działał poprawnie, musisz użyć wbudowanego css.

Oto lista referencyjna. http://www.campaignmonitor.com/css/
 71
Author: Brombomb,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-08-28 23:14:27

GMail nie obsługuje <style> tagi i nie ma wielu klientów. Aby ułatwić sobie życie, możesz użyć programu convert, aby przekonwertować znaczniki stylów do wbudowanego CSS: http://beaker.mailchimp.com/inline-css

 30
Author: Hengjie,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-02-19 22:51:18

Widzę, że używasz ID o nazwie # footer. Wygląda na to, że Google nie rozpoznaje tej nazwy, gdy ma do czynienia z pocztą. Zauważ, że w kodzie czcionki widocznym z Gmaila, wszystkie Twoje ID może pojawić się z "exc" + idName, z wyjątkiem #footer. Spróbuj użyć innej nazwy.

 2
Author: Didhack,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-10-02 15:40:15