PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Mail » Mail » Bug #7492

Extra newline added before body

Details

Submitted2006-04-26 11:44 UTC
Fromcweiske at cweiske dot de
Assignedjon
StatusClosed
PackageMail
PHP Version5.1.2
OSLinux
Roadmaps(Not assigned)

Comments

[2006-04-26 11:44 UTC] cweiske at cweiske dot de

Description:
------------
When using the "mail" mailer driver, an extra newline is inserted between the headers and the body. The problem occurs because the $text_headers parameter to the mail() call in Mail/mail.php lini 117-119 has a trailing newline.

Note that some mail clients (e.g. Mozilla Thunderbird) ignores this, but the extra newline can be seen using View Source.

Test script:
---------------
<?php
require_once 'Mail.php';

$headers['From'] = 'foo@example.com';
$headers['Subject'] = 'This is the subject';

$body = "This is the body";

$mail_object =& Mail::factory('mail');

$mail_object->send('foo@example.com', $headers, $body);
?>

Expected result:
----------------
To: foo@example.com
Subject: This is the subject
From: foo@example.com
Message-Id: <E1FYiJd-0006cm-5E@example.com>
Date: Wed, 26 Apr 2006 13:36:17 +0200

This is the body

Actual result:
--------------
To: foo@example.com
Subject: This is the subject
From: foo@example.com
Message-Id: <E1FYiJd-0006cm-5E@example.com>
Date: Wed, 26 Apr 2006 13:36:17 +0200

This is the body