HTML Mail显示空白邮件

时间:2012-02-05 13:49:07

标签: php html email

当我发送html邮件时,我可以在iPad和Gmail上阅读。但Outlook和我的iMac程序Mail没有显示正文消息。他们显示一条空白消息。下面我放置了原始信息。我希望有人能告诉我它有什么问题。

Delivered-To: ****@gmail.com
Received: by 10.50.196.*** with SMTP id io4cs329714igc;
        Sun, 5 Feb 2012 05:32:52 -0800 (PST)
Received: by 10.14.206.*** with SMTP id l5mr4398177eeo.22.1328448771870;
        Sun, 05 Feb 2012 05:32:51 -0800 (PST)
Return-Path: <***@***.nl>
Received: from ***.****.nl ([85.17.***.***])
        by mx.google.com with ESMTPS id n46si6997510eeh.10.2012.02.05.05.32.51
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sun, 05 Feb 2012 05:32:51 -0800 (PST)
Received-SPF: neutral (google.com: 85.17.145.53 is neither permitted nor denied by best guess record for domain of ***@***.nl) client-ip=85.17.145.***;
Authentication-Results: mx.google.com; spf=neutral (google.com: 85.17.145.*** is neither permitted nor denied by best guess record for domain of ***@***.nl) smtp.mail=***@***.nl
Received: from **** by ***.nl with local (Exim 4.72)
    (envelope-from <***@***.nl>)
    id 1Ru2CW-0000Fj-Dp; Sun, 05 Feb 2012 14:32:16 +0100
Date: Sun, 05 Feb 2012 14:32:16 +0100
Message-Id: <E1Ru2CW-0000Fj-Dp@***.***.nl>
To: ***@gmail.com
Subject: Test html mail
From: *****.nl<*****@*****.nl>
To: ***@gmail.com
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="9f540ec8b1c1552cbe71240502b3f9e8"
Sender:  <***@***.nl>

--9f540ec8b1c1552cbe71240502b3f9e8
Content-Type: text/plain; charset=iso-8589-1
Content-Transfer-Encoding: 8bit
If you are seeing this is because you may need to change your
preferred message format from HTML to plain text.

Activeer uw HTML mail instellingen.
--9f540ec8b1c1552cbe71240502b3f9e8
Content-Type: text/html; charset=iso-8589-1
Content-Transfer-Encoding: 8bit
<html>
<head>
<title>Hello world</title> 
</head>
<body>
this is a test.
</body>
</html>

我希望你理解我的问题。对不起,我的英语不好。

2 个答案:

答案 0 :(得分:2)

Content-Transfer-Encoding行后应该有空白行,HTML部分后面应该有一个封闭的边界:

--9f540ec8b1c1552cbe71240502b3f9e8
Content-Type: text/plain; charset=iso-8589-1
Content-Transfer-Encoding: 8bit

If you are seeing this is because you may need to change your
preferred message format from HTML to plain text.

Activeer uw HTML mail instellingen.
--9f540ec8b1c1552cbe71240502b3f9e8
Content-Type: text/html; charset=iso-8589-1
Content-Transfer-Encoding: 8bit

<html>
<head>
<title>Hello world</title> 
</head>
<body>
this is a test.
</body>
</html>
--9f540ec8b1c1552cbe71240502b3f9e8--

答案 1 :(得分:0)

发送邮件我喜欢这样:

$message = '<html><body><p align="center">XXXXXXXX</p></br></br></body></html>';
    $to = "mail@mail.it";
    $headers = "From: mail <no_reply@mail.it>\r\n"; 
    $headers .= "MIME-Version: 1.0" ."\n"; 
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $object = "";
    $result = mail($to, $object, $message, $headers);