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

报告相同问题?

悬赏问题

  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波