| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2016-03-07 09:39 UTC] bugs dot php at myrosoft dot com
 Description: ------------ Sending mail under Windows can sometimes modify the headers wrongly. Different headers are mixed up. eg.: 'Bcc: report.web@myrosoft.com'.$nl. 'Reply-to: noreply@myrosoft.com'.$nl. maybe transformed to BReply-to: noreply@myrosoft.com I have noticed different behaviour, depending on the script. Test script: --------------- http://myrosoft.com/Files/PhpBug/mail2.php PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 15:00:01 2025 UTC | 
Sorry this took so long to get back to, but the issue has not been resolved.... Example mailer code: ---------- /* * Use PHPMailer with php.ini "mail function" settings. * I'm sure just using the standard PHPMailer class without Joomla will produce the same. */ $mailer = JFactory::getMailer(); $mailer->LE = "\r\n"; // Line End CRLF $mailer->isHTML(true); $mailer->setFrom('mailer@example.com','SystemMailer'); $mailer->addRecipient('test@example.com','To Account'); $mailer->addCC('test2@example.com','CC Account'); $mailer->addBCC('test3@example.com','BCC Account'); $mailer->addReplyTo('test4@example.com','ReplyTo Account'); $mailer->setSubject('PHP 7.1.1 email Test'); $mailer->setBody('Sample email test.'); try { $mailer->send(); } catch (phpmailerException $e) { echo $e->errorMessage(); } catch (Exception $e) { echo $e->getMessage(); } ---------- Output from Smtp4Dev (with BCC): ---------- Subject: PHP 7.1.1 email Test To: To Account <test@example.com> X-PHP-Originating-Script: 0:class.phpmailer.php Date: Mon, 8 May 2017 11:14:53 -0400 From: SystemMailer <mailer@example.com> Cc: CC Account <test2@example.com> BReply-To: ReplyTo Account <test4@example.com> Message-ID: <e426383c205069ba6724f3ee692142fb@localhost> MIME-Version: 1.0 Content-Type: text/html; charset=utf-8 Sample email test. ---------- Output from Smtp4Dev (without BCC): ---------- Subject: PHP 7.1.1 email Test To: To Account <test@example.com> X-PHP-Originating-Script: 0:class.phpmailer.php Date: Mon, 8 May 2017 11:18:54 -0400 From: SystemMailer <mailer@example.com> Cc: CC Account <test2@example.com> Reply-To: ReplyTo Account <test4@example.com> Message-ID: <820a74989fdb906369fd2be445a0d06c@localhost> MIME-Version: 1.0 Content-Type: text/html; charset=utf-8 Sample email test. ---------- Switching around the order of the PHPMailer functions doesn't have an effect. If I remove BCC I get the replyTo correctly, but I can't tell what happens with the BCC if I remove the replyTo as it's not shown in smtp4dev.I still haven't been able to reproduce either. Using PHPMailer 5.2.23. Let's try PHPMailer without mail(). Can you do the same email but using $mailer->isSMTP(); $mailer->Host = "localhost"; $mailer->Port = 25; $mailer->SMTPDebug = 3; Assuming that works correctly, try the reverse of mail() without PHPMailer: $headers = implode("\r\n", [ "From: SystemMailer <mailer@example.com>", "Cc: CC Account <test2@example.com>", "X-Foo: foo", "Bcc: BCC Account <test3@example.com>", "X-Bar: bar", "Reply-To: ReplyTo Account <test4@example.com>" ]); mail("test@example.com", "PHP 7.1.1 email Test", "Sample email test.", $headers);