2012-02-05 4 views
2

Когда я отправляю html-почту, я могу прочитать ее на своем iPad и в Gmail. Но Outlook и на моем iMac в программе Mail не отображаются сообщения тела. Они показывают пустое сообщение. Ниже я разместил исходное сообщение. Надеюсь, кто-нибудь может сказать мне, что с ним не так.В HTML-почте отображается пустое сообщение

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: <[email protected]***.***.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> 

Надеюсь, вы понимаете мою проблему. Извините за мой плохой английский.

ответ

0

Чтобы отправить почту я сделать так:

$message = '<html><body><p align="center">XXXXXXXX</p></br></br></body></html>'; 
    $to = "[email protected]"; 
    $headers = "From: mail <[email protected]>\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); 
+0

Спасибо, но я хочу знать, что не так в моем скрипте. – Tim

+0

вы можете мне это показать? – JackTurky

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

спасибо, я собираюсь проверить это! – Tim

+0

hm, без эффекта. – Tim

+0

Эти изменения были необходимы, поэтому может возникнуть другая проблема с источником сообщений. Можете ли вы изменить свой вопрос, чтобы показать источник после того, как вы внесли эти изменения? – SimonMayer

Смежные вопросы