HTML电子邮件在outlook.com中显示混乱



我正在发送一个相当简单的多部分消息,其中包含纯文本和HTML版本。HTML版本是一个包含一些列的表,所有列的大小都以百分比表示。所有的样式都是内联的

在outlook.com中,它呈现得非常糟糕。查看源代码(在浏览器中- Firefox),我可以看到它正在篡改HTML。

例如,打开表标签是这样呈现的:

(嗯-所以mangledstackoverflow也不会渲染它)。

基本上它是剪掉属性的第一个字符,所以宽度="100%"呈现为宽度="00%",align=" left ",链接出现为"ttp://something.com",缺少引号等。在outlook.com中查看源代码根本不显示HTML -它必须通过javascript呈现,因为我只能使用Firebug看到它。

我试过有和没有条件注释(这是在Outlook应用程序),和有/没有doctype。没有什么能让它变得更好。我不知道发生了什么,也没有找到任何其他关于属性被截断的帖子。

任何想法吗?

这是电子邮件的HTML部分:

<!DOCTYPE html>
<html>
<body style="font-family: Arial, Helvetica, sans-serif; font-size: 14px;line-height: 1.4; color: #333;">
    <!--[if (gte mso 9)|(IE)]>
    <table width="600" align="center" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td>
                <![endif]-->
                <table style="width: 100%; max-width: 600px;" align="left" cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td colspan="3" width="100%" height="16"></td>
                    </tr>
                    <tr>
                        <td width="3%"></td>
                        <td><img src="https://www.domain.com/logo.png" width="203" height="38" alt="alt name" /></td>
                        <td width="3%"></td>
                    </tr>
                    <tr>
                        <td colspan="3" width="100%" height="30"></td>
                    </tr>
                    <tr>
                        <td width="3%"></td>
                        <td width="94%">
                            Hello,<br />
                            <br />
                            The Proof for Order Item #123 is ready for review. Please login to your account to review and approve the proof.<br />
                            <br />
                            Log in at <a href="https://www.domain.com/my-account/" style="color: #0c7ebd;">https://www.domain.com/my-account/</a> and choose "Proofs Waiting Approval" on the "My Account" page.<br />
                            <br />
                            Click the "Review" link for ID 123 - you will see your proof and you will be able to approve it for delivery. You will also have the opportunity to request changes.<br />
                            <br />
                            Please contact our office if you have any questions.<br />
                            Thank you.<br />
                            <br />
                            Sincerely,<span style="font-size: 4px;"><br />
                            <br />
                            </span>
                            <span style="font-size:13px; font-weight: bold;">COMPANY TEAM</span><br />
                            <span style="font-size: 9px;"><span style="color: #2b9f4c;">COMPANY</span> | CUSTOMER SERVICE</span><span style="font-size: 11px;"><br />
                            <span style="font-weight: bold;color: #0c7ebd;">T:</span> 888.555.2122</span><span style="font-size: 4px;"><br />
                            <br />
                            </span>
                            <span style="font-size: 10px;"><a href="https://www.domain.com" style="color: #0c7ebd;">www.domain.com</a><span style="font-size: 3px;"><br />
                            <br />
                            </span>
                            <img src="https://www.domain.com/images/email/ConsiderEnvironment.png" width="37" height="42" alt="" /> <span style="color: #2b9f4c;">Please consider the environment before printing this email</span></span>
                        </td>
                        <td width="3%"></td>
                    </tr>
                    <tr>
                        <td colspan="3" width="100%" height="30"></td>
                    </tr>
                </table>
                <!--[if (gte mso 9)|(IE)]>
            </td>
        </tr>
    </table>
    <![endif]-->
</body>
</html>

你的代码看起来很电子邮件友好!

我唯一的建议是根据Campaign Monitor的支持指南(https://i3.campaignmonitor.com/assets/files/css/campaign-monitor-guide-to-css-in-email-may-2014.pdf?ver=5117&_ga=1.123317261.720201475.1441145331)检查所有元素。

另一个方便的功能campaign monitor使用的是他们的测试系统,这也给了一个预览什么你的电子邮件会看起来像每个浏览器/电子邮件客户端(outlook.com是支持)。不幸的是,每次测试要花费5澳元,但有时我发现这笔费用是值得的,因为它总是准确的!

更多信息可以在这里找到:https://www.campaignmonitor.com/testing/

Ack -原来我有错误的Content-Transfer-Encoding。我把它设置为引号可打印,但应该是8位或7位。quotes -printable假定它是按照呈现的方式阅读的,而不是要解释的代码。我是这么想的。

奇怪的是,它在测试的每个其他客户端中都工作得很好。所以- "谢谢" outlook.com,你教会了我一些东西…

最新更新