php posta gönderirken: başlıklarını vücut olarak yorumlanır?

0 Cevap php

Ben \ r \ başlıklarında satır sonu n (as it should be according to documentation) ile php posta gönderdiğinizde

$headers = "From: $email\r\n"; 
$headers .= "Reply-To:  Just me <$email>\r\n"; 
$headers .= 'Content-type: text/plain; charset=iso-8859-1' . "\r\n";
$headers .= "Content-Transfer-Encoding: 8bit\r\n";
$subject = "Hello world";
$body = "<html><p>Hey, whats up?</p></html>";

mail($to, $subject, $body, $headers);

Bazı posta istemcileri iki satır kesmeleri olarak \ r \ n yorumlayacaktır. Yani () gerçek posta içeriğinin üstünde bu posta için bu gibi görünecektir:

X-Message-Delivery: Vj0LEdMMtPAYT0xO0Q9MTtTQ0w9MA==
X-Message-Status: n
Received: from server75.publicompserver.de ([92.43.108.63]) by snt0-mc2-f13.Snt0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675);
 Thu, 9 Dec 2010 12:09:22 -0800
Message-ID: <40177C.70807@justme.org>
[lots of other headers]
Date: Thu, 09 Dec 2010 21:09:32 +0100
X-OriginalArrivalTime: 09 Dec 2010 20:09:22.0873 (UTC) FILETIME=[F88C3A90:01CB97DC]
From: $email

Reply-To:  Just me <$email>

Content-type: text/html; charset=iso-8859-1

Content-Transfer-Encoding: 8bit

<html><p>Hey, whats up?</p></html>

Şimdi bazı istemciler (örneğin googlemail) bu ekstra linebreaks göz ardı edecektir. Diğerleri (thunderbird) başlıkları sonu olarak ilk ekstra satır aralığı yorumlamak ve (yerine html metin olarak posta işleme Bu durumda, başlık bilgilerini kaybetme) vücudun bir parçası olarak başlık satırlarından kalanını yorumlayacaktır.

Ben de, diğer posta gönderme web sitelerinden aynı sorunu gördüm.

What is happening here? \r\n is the correct line break according to doc, or is something else going wrong here? And how can it be resolved? Changing the line break to \n instead of \r\n seems to help, but since the docs say "thou should use \r\n" this can't be right, can it?

0 Cevap