Why hotmail don't show the body of this html email?

六眼飞鱼酱① 提交于 2019-12-06 16:27:30

It was only lacking a new line at the top of the html code. i.e. :

--B_ALT_4fb34ce59161d
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable


<html>
...

Instead of

--B_ALT_4fb34ce59161d
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html>
...

curious, isn't it ?

We ran into this in our web app, and I found that CSS comments were the culprit in our environment. After trying the above solutions with no success, I began dissecting our HTML templates line by line, section by section.

In our environment we use PreMailer.net (https://github.com/milkshakesoftware/PreMailer.Net) to inline our CSS styles from a normal stylesheet and inject it into the HTML email templates via partials. In those partial CSS files, there were CSS comments. When I removed those, the emails rendered properly in the outlook.com web client (which also provides mail service for @hotmail and @live accounts).

In our app, I changed the CSS comments from /* */ to server side comments @* *@ (we're using razor syntax for our .NET MVC 4 app) and that did the trick.

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