php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52681 mb_send_mail() appends an extra MIME-Version header
Submitted: 2010-08-24 00:15 UTC Modified: 2010-08-25 08:07 UTC
From: puhv at hot dot ee Assigned: aharvey (profile)
Status: Closed Package: mbstring related
PHP Version: 5.3.3 OS: Linux
Private report: No CVE-ID: None
 [2010-08-24 00:15 UTC] puhv at hot dot ee
Description:
------------
Specifying a MIME-Version header when using mb_send_mail() results in such a header appearing twice in the e-mail message.

Also note that RFC2045 spells the initialism MIME in upper case and requires the text "MIME-Version: 1.0" to be verbatim (although ignoring RFC822 comment strings is required), see http://tools.ietf.org/html/rfc2045#section-4


Test script:
---------------
<?php
$headers = 'From: Someone <someone@somewhere.invalid>' . "\n"
    . 'MIME-Version: 1.0' . "\n"
    . 'Content-Type: text/plain; charset=UTF-8' . "\n"
    . 'Content-Transfer-Encoding: 8bit';
mb_send_mail('john@smith.invalid', 'Test', 'Testing', $headers);
?>


Expected result:
----------------
E-mail message with the following headers:

To: john@smith.invalid
Subject: Test
From: Someone <someone@somewhere.invalid>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Message-ID: <20100823191234.ABCDEF1234@host.domain.invalid>
Date: Mon, 23 Aug 2010 22:12:34 +0300 (EEST)


Actual result:
--------------
E-mail message has the following headers:

To: john@smith.invalid
Subject: Test
From: Someone <someone@somewhere.invalid>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Mime-Version: 1.0
Message-Id: <20100823191234.ABCDEF1234@host.domain.invalid>
Date: Mon, 23 Aug 2010 22:12:34 +0300 (EEST)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-25 07:50 UTC] aharvey@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: aharvey
 [2010-08-25 08:07 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=302758
Log: Fixed bug #52681 (mb_send_mail() appends an extra MIME-Version header).
 [2010-08-25 08:07 UTC] aharvey@php.net
-Status: Assigned +Status: Closed
 [2010-08-25 08:07 UTC] aharvey@php.net
This bug has been fixed in SVN.

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/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 20:01:45 2024 UTC