Home » Mail » Mail » Bug #7492
Extra newline added before body
Details
| Submitted | 2006-04-26 11:44 UTC |
|---|---|
| From | cweiske at cweiske dot de |
| Assigned | jon |
| Status | Closed |
| Package | |
| PHP Version | 5.1.2 |
| OS | Linux |
| 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