drvxclagw656708070 2014-07-29 09:57
浏览 921
已采纳

Outlook显示电子邮件html,好像它是纯文本,太多换行符

I can generate emails in php and send them so that they are correctly shown as html in Gmail and Apple mail and other client. I also do not get any formatting errors from spam assassin.

However, one receiver using Outlook 14 on Mac OS X receives the emails as though the html part were plain text. The same thing happens if I disable spam assassin on his hosting account. Here is the source of such an email when it is received by the user (edited to remove domain names and email addresses and shorten the message body):

Return-path: <_www@[domain].com>
Envelope-to: info@[domain].com
Delivery-date: Tue, 29 Jul 2014 01:39:03 -0700
Received: from [domain].com ([212.85.69.251]:50283)
by biz61.inmotionhosting.com with esmtp (Exim 4.82)
(envelope-from <_www@[domain].com>)
id 1XC2w3-0003s4-C7
for info@[domain].com; Tue, 29 Jul 2014 01:39:03 -0700
Received: by [domain].com (Postfix, from userid 70)
id 693E248D80BC; Tue, 29 Jul 2014 10:39:02 +0200 (CEST)
To: info@[domain].com
Subject: test2 - ignore - Link
From: Action Sports <noreply@[domain].com>
Reply-to: [my-email]@[domain].com
Cc: [my-email]@[domain].com
Sender: info@[domain].com
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary=c4d5d00c4725d9ed0b3c8b
Message-Id: <20140729083902.693E248D80BC@[domain].com>
Date: Tue, 29 Jul 2014 10:39:02 +0200 (CEST)

--c4d5d00c4725d9ed0b3c8b

Content-type: text/plain; charset=utf-8


testing - ignore





--c4d5d00c4725d9ed0b3c8b

Content-type: text/html; charset=utf-8



<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style TYPE="text/css">
<!--
table{
border-collapse:collapse;
border:1px solid #888;
}

table td, table th{
border:1px solid #888;
padding:3px;
}
-->
</style></head>
<body>

testing - ignore 
<br>



</body>
</html>



--c4d5d00c4725d9ed0b3c8b--

Here is what Outlook displays as the human readable content of the mail when opened normally in a new window:

[ at the top is the normal outlook header, followed by the following blank line: ]

Content-type: text/html; charset=utf-8



<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style TYPE="text/css">
<!--
table{
border-collapse:collapse;
border:1px solid #888;
}

table td, table th{
border:1px solid #888;
padding:3px;
}
-->
</style></head>
<body>

testing - ignore
<br>


</body>
</html>



[the message ends with about 4 empty lines]

If I send the same email to my Gmail account, it looks ok and has less empty lines if I view the source.

I now believe the extra empty lines are causing outlook to misunderstand that the last part is supposed to be displayed as HTML. What is causing the extra empty lines?

Am I supposed to use line breaks in the header but line breaks in the message body?

  • 写回答

2条回答 默认 最新

  • douzhu5900 2014-07-29 10:41
    关注

    After testing it turns out that if I use , i.e., the standard line break according to the RFC, for the header as before but change to using only , i.e., the non-standard line break for the message body including the multipart/alternative boundary and the multipart content-type rows it works in Googlemail and a bunch of other clients tested, and even in Outlook 14 for OS X.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 multisim中关于74ls192n和DSWPK开关的问题(相关搜索:计数器)
  • ¥15 在误装Windows server2019 后如何利用Windows.old恢复?
  • ¥20 代码实现状态连接包过滤防火墙的设计与实现
  • ¥15 vscode的红色箭头爆红和has no default export报错
  • ¥15 关于#sql#的问题:#情况描述 在用vs对项目进行调试时,出现找不到网络路径,然后查看SQL配置工具,发现SQL服务显示远程调用过程失败(相关搜索:防火墙)
  • ¥15 eNSP中基于默认路由及浮动路由的公司与分部互联和校园网综合项目
  • ¥15 主要进行描述泥浆在管路不同区段泥浆的密度不相同,泥浆的密度有高有低,此时管路的摩阻分布需要怎么计算,(标签-matlab)
  • ¥40 通过编制程序计算圆管内层流充分发展对流换热,参数如图5-4,以及公式5-16所示,要求用表5-6对程序计算准确性进行验证
  • ¥20 该学习哪个编程语言? AI会取代程序员吗?
  • ¥15 ensp如何拼通IP地址