PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Mail » Mail_Mime » Bug #4020

Content-type not added in headers

Details

Submitted2005-03-31 19:29 UTC
Fromeven at lynweb dot no
Assignedsean
StatusBogus
PackageMail_Mime
PHP Version4.3.10
OSLinux/Debian and OS X 10.3.9
Roadmaps(Not assigned)

Comments

[2005-03-31 19:29 UTC] even at lynweb dot no

Description:
------------
When using the Mime_mail::headers($array) function, the
Content-type of the mail does not get set for some
reason.
This is obviously a big problem, since HTML mails and
such will not get displayed correctly in any email-
readers.

As far as I can tell, Mime_mail does not have any
special dependencies that can cause this problem?
Anyone else having this problem?

Reproduce code:
---------------
require_once('Mail.php');
require_once('Mail/mime.php');

$mail = new Mail_mime("\n");
$mail->setTXTBody('Plain-text version');
$mail->setHTMLBody('<html><body>This should be the HTML-version</body></html>');
$headers = array('From' => 'user@domain.com',
'Subject' => 'Test mime message'
);
$headers = $mail->headers($headers);
var_dump($headers);

Expected result:
----------------
array(4) {
    ["MIME-Version"]=>
    string(3) "1.0"
    ["From"]=>
    string(15) "user@domain.com"
    ["Subject"]=>
    string(17) "Test mime message"
    ["Content-Type"]=>
    string(64) "multipart/mixed;
    boundary="=_307c199ae5303dac356d5cf48c89fc7c""
}

Actual result:
--------------
array(3) {
    ["MIME-Version"]=>
    string(3) "1.0"
    ["From"]=>
    string(15) "user@domain.com"
    ["Subject"]=>
    string(17) "Test mime message"
}