HTML email doesn't display correctly in Google Apps/Gmail

倖福魔咒の 提交于 2019-12-07 15:22:30

问题


My web application sends HTML-based e-mail to users.

I've created a HTML e-mail template (based off a template provided by MailChimp which is supposedly designed to work in any browser/email client).

When I send it using SendGrid, it arrives and displays perfectly on my Apple iPhone 4 but doesn't display correctly when I test it in Gmail/Google Apps (using both Firefox and Google Chrome).

The HTML code snippet that isn't working properly:

<tr>
    <td align="center" valign="top" style="padding-top:0;">
        <table border="0" cellpadding="15" cellspacing="0" class="templateButton3">
            <tr>
                <td valign="middle" class="templateButtonContent">
                    <div mc:edit="std_content01">
                        <a href="http://www.url.com/blah" target="_blank">Button Text</a>
                    </div>
                </td>
            </tr>
        </table>
    </td>
</tr>

The CSS applied here is:

.templateButton3{
    -moz-border-radius:3px;
    -webkit-border-radius:3px;
    /*@editable*/ background-color:#d34843;
    /*@editable*/ border:0;
    border-collapse:separate !important;
    border-radius:3px;
}

What am I doing wrong here? Is this an annoying side effect of using Google Apps/Gmail?


回答1:


All CSS must be inline on the td. This will do it for you: http://beaker.mailchimp.com/inline-css

MailChimp automatically does this, if you are not using MC but making use of their template, you must inline the CSS yourself.




回答2:


Just to back up what samantha said, ios will take into consideration what is between the tags.. gmail or google apps won't.



来源:https://stackoverflow.com/questions/17038780/html-email-doesnt-display-correctly-in-google-apps-gmail

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!