ID:               23525
 Comment by:       Mike Little <phpbugs at zed1 dot com>
 Reported By:      joce at presence-pc dot com
 Status:           Closed
 Bug Type:         Mail related
 Operating System: linux
 PHP Version:      4.3.2RC2
 New Comment:

This bug (or a variant of it) still seems to exist (current in version
4.3.6 build May 26 2004).
My experiments have show that if I add a 'MIME-Version: 1.0' header
then PHP adds an extra carriage return newline after it.
This code (taken from Wordpress) reproduces the problem:

$message_headers = "MIME-Version: 1.0\r\n"
. "$from\r\n"
. "Content-Type: text/plain; charset=\"" . get_settings('blog_charset')
. "\"\r\n";
@mail($user->user_email, $subject, $notify_message, $message_headers);

There is an extra blank line after the MIME-Version header.

If you replace the MIME-Version header with "Reply-To: fred\r\n" you do
NOT get an extra blank line.
If you replace it with "X-Hello: world\r\n" then again you do get the
blank line.

It appears to be related to whether the header in question is a 'well
known' header???


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

[2003-05-07 15:36:17] [EMAIL PROTECTED]

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.



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

[2003-05-07 06:55:55] joce at presence-pc dot com

Hi,

With the following script :

<?
$headers_html  = "MIME-Version: 1.0\n";
$headers_html .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$headers_html .= "From: Presence PC - Lettre express
<[EMAIL PROTECTED]>\n";
$headers_html .= "Return-Path: [EMAIL PROTECTED]";

mail('[EMAIL PROTECTED]', 'test', 'test', $headers_html);
?>

Using PHP-4.3.2RC1, all works just fine and I'm receiving :

'test'

Using PHP-4.3.2RC2, header infos are no longer rightly interpreted, and
I'm receiving a mail containing :

'MIME-Version: 1.0
Content-Type: text/html; charset="iso-8859-1"
From: Presence PC - Lettre express <[EMAIL PROTECTED]>



test'

(ie only Return-Path header info is interpreted)

Regards,
  Jocelyn Fournier

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


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

Reply via email to