Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.0.0

Bug #2476 Mail Package: Bcc Header visible
Submitted: 2004-10-07 15:22 UTC
From: bmichel at gunterra dot com Assigned:
Status: Bogus Package: Mail
PHP Version: 4.3.8 OS: Fedora Core 1
Roadmaps: (Not assigned)    
Subscription  


 [2004-10-07 15:22 UTC] bmichel at gunterra dot com
Description: ------------ Hello, Send email with Bcc header. When email arrives, Bcc recipients are visibles. regards Brice Reproduce code: --------------- $recipients = $db->fields['email']; $headers['From'] = 'Admin <admin@gunterra.com>'; $headers['To']= 'MyTest <mtest@gunterra.com>'; $headers['Bcc']= 'MyBCC <test@gunterra.com>'; $headers['Subject'] = 'New password generated'; $params['host'] = $domain_name; $params['port'] = '25'; $params['auth'] = true; $params['username'] = $admin_user_name; $params['password'] = $admin_password; $mime = new Mail_mime("\n"); $text = 'Your new password is '.$new_password; $mime->setTXTBody($text); $content = $mime->get(); // Create the mail object using the Mail::factory method $mail_object =& Mail::factory('smtp', $params); $mail_object->send($recipients, $mime->headers($headers), $content); Expected result: ---------------- header received : . . MIME-Version: 1.0 From: "Admin" <admin@gunterra.com> To: "MyTest" <mtest@gunterra.com> Subject: New password generated . . . Actual result: -------------- header received : . . MIME-Version: 1.0 From: "Admin" <admin@gunterra.com> To: "MyTest" <mtest@gunterra.com> Bcc: MyBCC <test@gunterra.com> Subject: New password generated . . .

Comments

 [2004-10-07 15:49 UTC] chagenbu
Put bcc recipients into the $recipients variable; the headers you pass in are the headers you wish to appear in the message that's sent.
 [2005-02-24 14:14 UTC] cassabarbosa at ig dot com dot br
How can I do this in the recipients variable ? Thanks.
 [2007-08-23 01:27 UTC] dhoff (David Hoff)
I have worked many hours on this problem with no success. I tried mod to the mime.php headers() method even to write the from,to,cc,bcc prior to the mime and no success. The email comes to recipient only via smtp using Mail Factory, despite the mime header functionality that allows adding via the getMessage methods addCc() addBcc() in mime.php. The prior post said to put everyone in the recip field which is a joke to suggest. This should be a professional solution, not an idiot patch. David
 [2009-01-21 10:13 UTC] vzeman (Viktor Zeman)
Solution: - in case is used SMTP method, add bcc recipients to recipients list and unset header field bcc - in case of mail method leave as it is: filled recipients and also bcc header This does the trick