#33976 [Opn->Fbk]: mail() overrides the provided header

From: Date: Wed, 03 Aug 2005 12:08:34 +0000
Subject: #33976 [Opn->Fbk]: mail() overrides the provided header
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-82872@lists.php.net to get a copy of this message
 ID:               33976
 Updated by:       tony2001@php.net
 Reported By:      dominik dot blystak at pro-open dot de
-Status:           Open
+Status:           Feedback
 Bug Type:         Mail related
 Operating System: Mandrake Linux
 PHP Version:      4.3.11
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip




Previous Comments:
------------------------------------------------------------------------

[2005-08-03 14:05:05] dominik dot blystak at pro-open dot de

Description:
------------
In php 4.3.10 and 4.3.4 of Mandrake Linux I encountered the following
behaviour. The mail() function sets a second mime-header with 
Content-Type: text/plain; charset=UTF-8 and Content-Transfer-Encoding:
BASE64 regardless of an already provided header. I could verify this
problem with example code of the mail() documentation.

Reproduce code:
---------------
<?php
        $to  = "dominik.blystak@pro-open.de"; // beachten Sie das
Komma
        $subject = "Geburtstags-Erinnerung für August";
        $message = '
        <html>
        <head>
         <title>Geburtstags-Erinnerung für August</title>
         </head>
         <body>
         <p>Hier sind die Geburtstage im August!</p>
                     </body>
                     </html>
                     ';
        $headers  = "MIME-Version: 1.0\r\n";
        $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
        $headers .= "Content-Transfer-Encoding: quoted-printable\r\n";
        mail($to, $subject, $message, $headers);
?>


Expected result:
----------------
There is just one mime-header (reduced to relevant parts):

To: my@mail.com
Subject: Geburtstags-Erinnerung für August
MIME-Version: 1.0
Content-type: text/html;
  charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Message-Id: <20050803115921.B21BF9DCE6@server.com>
Date: Wed,  3 Aug 2005 13:59:21 +0200 (CEST)
From: apache@server.com (system user for apache)
X-Length: 1114
X-KMail-EncryptionState:  
X-KMail-SignatureState:  
X-KMail-MDN-Sent:  
X-UID: 1135
Status: RO
X-Status: OC

	<html>
	<head>
	 <title>Geburtstags-Erinnerung für August</title>
	 </head>
	 <body>
	 <p>Hier sind die Geburtstage im August!</p>
		     </body>
		     </html>

Actual result:
--------------
There are two mime-headers (reduced to relevant parts):

To: my@mail.com
Subject: Geburtstags-Erinnerung =?UTF-8?B?ZsO8ciBBdWd1?=
 =?UTF-8?B?c3Q=?=
MIME-Version: 1.0
Content-type: text/html;
  charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: BASE64
Message-Id: <20050803115702.836366BC021@server.com>
Date: Wed,  3 Aug 2005 13:57:02 +0200 (CEST)
From: apache@server.com (system user for apache)
X-UID: 39490
X-Length: 1211
Status: R
X-Status: NC
X-KMail-EncryptionState:  
X-KMail-SignatureState:  
X-KMail-MDN-Sent:  

Cgk8aHRtbD4KCTxoZWFkPgoJIDx0aXRsZT5HZWJ1cnRzdGFncy1FcmlubmVydW5nIGbDvHIgQXVn
dXN0PC90aXRsZT4KCSA8L2hlYWQ+CgkgPGJvZHk+CgkgPHA+SGllciBzaW5kIGRpZSBHZWJ1cnRz
dGFnZSBpbSBBdWd1c3QhPC9wPgoJCSAgICAgPC9ib2R5PgoJCSAgICAgPC9odG1sPgoJCSAgICAg



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33976&edit=1


Thread (4 messages)

« previous php.bugs (#82872) next »