生成的HTML邮件未在Thunderbird中正确显示(在Evolution或roundcube Webmail中看起来不错)
|
我正在用PHP发送HTML邮件,Evolution端Roundcube网络邮件完美地接收了该邮件,但是当我在Mozilla Thunderbird中查看该邮件时,我看到的只是纯文本格式的html。
这是邮件的开头:
Return-Path: <www-data@me.be>
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on KIP-DU-VPS
X-Spam-Level:
X-Spam-Status: No, score=-100.8 required=5.0 tests=BAYES_00,HTML_MESSAGE,
HTML_MIME_NO_HTML_TAG,MIME_HTML_ONLY,NO_RELAYS,USER_IN_WHITELIST autolearn=no
version=3.3.1
X-Original-To: me@me.be
Delivered-To: me@me.be
Received: by me.be (Postfix, from userid 33)
id 232B627273; Mon, 30 May 2011 14:41:39 +0200 (CEST)
To: me@me.be; other@me.be
Subject: [Content] Uw aanvraag werd goedgekeurd
From: FromName <mailer@me.be>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=\"398a5f7c07527a0a59c4d87e6547f2d5\"
Message-Id: <20110530124139.232B627273@me.be>
Date: Mon, 30 May 2011 14:41:39 +0200 (CEST)
--398a5f7c07527a0a59c4d87e6547f2d5
Content-Type: text/html; charset=\"utf8\"
Content-Transfer-Encoding: 7bit
<br/><head>
<style type=\"text/css\">
在HTML内剪裁
</body>
--398a5f7c07527a0a59c4d87e6547f2d5
Content-Type: application/octet-stream; name=\"onkosten.pdf\"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=\"onkosten.pdf\"
JVBERi0xLjQNCjEgMCBvYmoNCjw8DQovQ3JlYXRvciA8RkVGRjAwNEIwMDZEMDAyRDAwNzYwMDY1
MDA3MjAwNjcwMDZFMDA2MTAwNzMwMDYzMDA2ODAwNkYwMDZDMDA2OTAwNkUwMDY3MDAyRTAwNzgw
剪下附件
OTI0IDAwMDAwIG4NCjAwMDAwMDI3MTIgMDAwMDAgbg0KMDAwMDAyMTgxOCAwMDAwMCBuDQowMDAw
MDIzMjA3IDAwMDAwIG4NCjAwMDAwMjQ2MTEgMDAwMDAgbg0KdHJhaWxlcg0KPDwNCi9TaXplIDE1
DQovSW5mbyAxIDAgUg0KL1Jvb3QgMiAwIFINCi9JRFs8ZjU2Y2E5ZmFlNjY5MmQzZmNhOGQyOTIz
ZjUxNzFmYTY+PGY1NmNhOWZhZTY2OTJkM2ZjYThkMjkyM2Y1MTcxZmE2Pl0KPj4NCnN0YXJ0eHJl
Zg0KMjUwMzINCiUlRU9GDQo=
--398a5f7c07527a0a59c4d87e6547f2d5--
Thunderbird将\“ From \”行之后的所有内容呈现为纯文本主体。
(从\“ MIME版本:1.0 \”开始)
邮件有问题吗?
这是发送带有附件的邮件的功能:
函数mailAttachmentHeader($ attachment,$ message){
$ mime_boundary = md5(time());
$ xMessage = \“内容类型:多部分/混合;边界= \\\” \“。$ mime_boundary。\” \\\“ \\ r \\ n \\ r \\ n \”;
$ xMessage。= \“-\”。$ mime_boundary。\“ \\ r \\ n \”;
// $ xMessage。= \“内容类型:文本/纯文本; charset = \\\” iso-8859-1 \\\“ \\ r \\ n \”;
$ xMessage。= \“内容类型:文本/ html; charset = \\\” utf8 \\\“ \\ r \\ n \”;
$ xMessage。= \“内容传输编码:7bit \\ r \\ n \\ r \\ n \”;
$ xMessage。= $ message。\“ \\ r \\ n \\ r \\ n \”;
foreach($ attachment as $ file){
$ xMessage。= \“-\”。$ mime_boundary。\“ \\ r \\ n \”;
$ xMessage。= \“内容类型:应用程序/八位字节流; name = \\\” \“。basename($ file)。\” \\\“ \\ r \\ n \”;
$ xMessage。= \“ Content-Transfer-Encoding:base64 \\ r \\ n \”;
$ xMessage。= \“ Content-Disposition:附件; filename = \\\” \“。basename($ file)。\” \\\“ \\ r \\ n \\ r \\ n \”;
$ content = file_get_contents($ file);
$ xMessage。= chunk_split(base64_encode($ content));
$ xMessage。= \“ \\ r \\ n \\ r \\ n \”;
}
$ xMessage。= \“-\”。$ mime_boundary。\“-\\ r \\ n \\ r \\ n \”;
返回$ xMessage;
}
没有找到相关结果
已邀请:
0 个回复