HTML formatted email not showing up at all in Gmail but is in other mail clients

Related searches

I'm currently sending html formatted emails from PHP's mail() function and checking them simply to make sure they are showing up as HTML (formatting aside, I'm well aware that the formatting will vary (probably drastically) from client to client). They are displaying as HTML in the Apple Mail client as well as on my iPhone. However, Gmail simply refuses to display it as HTML as all. And by that I don't mean it is formatted incorrectly, it just simply isn't using HTML it appears.

The weird part is that an img from a tag is being loaded, but that's about it... is it that I'm mostly using divs for layout and that's too new for Gmail or something (vs tables)?

As far as CSS and what not goes, viewing the raw source shows the following:

<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>

As well as:

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

I'm confused as to why third party clients would show it fine but Gmail simply ignore it?

I am updating my answer since it has quite a few views, and new tools are available. I am leaving my original answer for posterity.

Edit * 9/19/19

You can find CSS property support by email client here:

Original Answer:

Gmail does not support the <style> tag. You need to use inline css for gmail to work correctly.

Here's a reference list.

Developing HTML Emails for Gmail: 12 Things You Must Know , The Gmail Android app that comes pre-installed with most new The Gmail Android and iOS apps does not support <style> at all when Although they are supported in modern email clients such as iOS and Apple Mail, Gmail does not Insert an anchor around the URL or email address and format it like� I'm using Gmail on Chrome, on MacbookPro 13. Since this morning or yesterday, the formatting bar at the bottom of compose new email has disappeared. I can only see the font, but not other buttons like bold, italics, underline and so on. If I click on the buttons, it will still perform the function. (ie makes the word bold).

GMail doesn't support <style> tags and neither does a number of clients. To make your life easier, you can use convert to convert your style tags to inline CSS:

Why do some email clients show my email differently than others , Email clients very rarely have their own HTML rendering engine (that's the POP and IMAP are protocols that an email client may use to talk to a mail server. Web-based email clients (such as or Gmail) will certainly any different to BODY elements, so it makes sense to bring them all below� Mistake #5: Not testing your email out with a variety of popular email services. It’s easy to forget that email clients use different coding to display your emails. This means that an email in AOL may look differently than an email in yahoo or Gmail. Here are a few ways to tackle this issue: Be obsessive about sending test emails.

I see you're using an ID named #footer. It seems that Google doesn't recognize that name when dealing with mails. Notice that in the font code seen from gmail, all your ID might appear with "exc" + idName, except #footer. Try to use a different name.

Font randomly changed in Gmail on recipient's end, I am not an expert in coding but I think it has something to do with how to send email as "Plain Text" or "Rich Text" and not "HTML" the problem was solved. " Mail" --> and then under "Compose message in this format" and in The recipient's browser/email client settings determine how text is displayed. Try sending to addresses under different domains, and viewing them using different mail clients. This can show if the HTML is being displayed as plain text in all cases, or only in cases with certain providers. Certain mail systems will display HTML in emails as plain text if a Reply To address is not specified.

The above answers are pretty good, just wanted to add a few more points. All credits to this link:

  1. Gmail only supports <style> in the <head>. Gmail does support embedded styles (<style>). However, embedded styles are only supported in the head of your HTML document. The Gmail Android and iOS apps does not support <style> at all when rendering emails retrieved through non-Google accounts (GANGA).

  2. Gmail removes your entire <style> block if it encounters an error.

  3. Gmail does not allow negative CSS margin values.

  4. Gmail does not support attribute selectors and most pseudo-classes. e.g. div[class="content"]{ color: red }. Gmail also does not support pseudo-classes like :checked and :active.

How to Send HTML Email in Gmail, Sending HTML emails with Gmail isn't as obvious as it might seem. We describe how to do it and give tips on building some great HTML templates Log in Sign up or other more complex formatting, not available in the default editor. to send it with Gmail or use any other client or email service provider� 7. Gmail does not support attribute selectors and most pseudo-classes. Attribute selectors (like the one below) allow for a more flexibility when selecting of elements in CSS. Although they are supported in modern email clients such as iOS and Apple Mail, Gmail does not support them. div[class="content"]{ color: red }

1. Begin by opening up Windows Live Mail 2011. Click on the "Windows Mail" button and select "Safety options…" from the "Options" menu. 2. Select the "Security" tab to continue. 3. Under the "Download Images" heading, uncheck the checkbox next to "Block images and other external content in HTML email" to allow HTML formatted emails to display

Windows Mail application has not been showing any attachments for emails. Gmail shows the date of an email in the last column of your email overview. Pop-up menu should have trash button. For me, it says "1-25 of 19,752. HTML formatted email not showing up at all in Gmail but is in other mail clients.

When you reply to a message, Outlook preserves the format of the original message. If you select the Read all standard mail in plain text option, however, Outlook formats your reply in plain text. Or you can click the InfoBar, change the format of the message to HTML or Rich Text, and then reply. If you change the format of the message, the

  • Can you post the entire source (including headers) of one of your messages?
  • Your HTML-example ends after the opening <body>-tag…
  • I added all of the headers as well as the rest of the HTML
  • Really? Wow. That's pretty bad... Thanks for the link.
  • Wow, it's amazing to see such a bad support from Gmail which is one of the most popular email services! Apple mail and Android 4 (Gmail) seem to be way ahead with the support. I'm really surprised about Gmail though!
  • Running your HTML through this library before mailing it will take the styles from your head and parse them to inline.
  • Gmail now does support styles but this won't help for all the other web based email clients.
  • @Solvitieg The link above is still relevant and up to date with email clients. Yes this is still the same issue with email clients from 5 years ago.
  • That's the handiest tool and link for this task. Thanks!