【问题标题】:HTML Mail displays a blank messageHTML Mail 显示空白邮件
【发布时间】:2012-02-05 13:49:07
【问题描述】:

当我发送 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>

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

【问题讨论】:

    标签: php html email


    【解决方案1】:

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

    【讨论】:

    • 这些更改是必要的,因此消息源可能存在另一个问题。您可以在进行这些更改后编辑您的问题以显示来源吗?
    • @Tim 要检查的另一件事-您是否用“\r”和“\n”字符分隔每一行?标准要求它。如果您只包括一个,它将解释跨客户端的性能不一致(特别是在不同的操作系统上)
    【解决方案2】:

    要发送邮件,我这样做:

    $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);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-07-02
      • 1970-01-01
      • 2020-03-08
      • 1970-01-01
      • 2014-11-20
      • 1970-01-01
      • 2020-05-02
      相关资源
      最近更新 更多