Issue Type: Bug Created: 2010-08-12T20:18:21.000+0000 Last Updated: 2010-10-25T16:59:37.000+0000 Status: Closed Fix version(s): Reporter: Scott Connerly (scottconnerly) Assignee: Dolf Schimmel (Freeaqingme) (freak) Tags: - Zend_Mail
Related issues: Attachments:
Similar to ZF-928
given the following code:
<pre class="highlight"> $mail = new Zend_Mail(); $mail->setSubject('my subject'); $mail->setBodyText('my body'); $mail->setFrom('email@example.com'); $mail->addTo('firstname.lastname@example.org'); $mail->addBcc('email@example.com'); $mail->addBcc('firstname.lastname@example.org'); print_r($mail); $mail->send();
First off, the print_r($mail) output before sending the mail shows the Bcc's as _recipients (which later make their way onto the To: line
<pre class="highlight"> [_headers:protected] => Array ( [Subject] => Array (  => my subject ) [From] => Array (  => email@example.com [append] => 1 ) [To] => Array (  => firstname.lastname@example.org [append] => 1 ) [Bcc] => Array (  => email@example.com [append] => 1  => firstname.lastname@example.org ) ) [_from:protected] => email@example.com [_to:protected] => Array (  => firstname.lastname@example.org ) [_recipients:protected] => Array ( [email@example.com] => 1 [firstname.lastname@example.org] => 1 [email@example.com] => 1 )
The resulting email got the following messed up headers:
<pre class="highlight"> To: firstname.lastname@example.org,email@example.com,firstname.lastname@example.org From: email@example.com firstname.lastname@example.org
When running the test again without the 'From' header, the results are as such:
<pre class="highlight"> To: email@example.com,firstname.lastname@example.org,email@example.com firstname.lastname@example.org
I would mark this higher than Major if at all possible due to the privacy issues involved.
My own alterations to fix this in the short-term include removing the $this->EOL from the implode() inside _prepareHeaders() and having getRecipients() return $this->_to rather than array_keys($this->_recipients);
Posted by Marc Hodgins (mjh_ca) on 2010-10-25T16:59:32.000+0000
Tested against r23236 and cannot reproduce. The unit test for ZF-928 -- testZf928ToAndBccHeadersShouldNotMix() located in tests/Zend/Mail/MailTest.php) -- seems to cover this. Please re-open with a working test case if the problem persists.
What mail transport are you using?
Have you found an issue?
See the Overview section for more details.