The BCC (blind carbon copy) "header" is not really an e-mail header. Clearly, it cannot be an e-mail header, because if it were, then recipients could examine it, and would no longer be "blind". Rather, BCC is a concept used by mail user agents, and usually implemented to that it appears (to end users) to be a header.
Firstly, you need to understand that the message headers are not used to route the message to its recipients - they are purely informational. Instead, so called envelope addresses (part of SMTP) are used.
And so, to implement BCC, what mail clients do, is simply send the e-mail to the intended recipient using the envelope address, but without adding any message header.
In your particular case, what you need to do is:
Something along these lines (though it isn't clear from your example what exactly $email_cc and $email_bcc contain - a single address, a comma-separated list, etc).
my $email = Email::MIME->create( header_str =>[ To => $email_to, Cc => $email_cc, From => $email_from, Subject => $email_subject ], body_str =>$email_body, attributes => { content_type => 'text/html', charset => 'utf8', encoding => 'quoted-printable' } # ... try { sendmail( $email, { to => [$email_to, $email_cc, $email_bcc], from => $email_from, transport => Email::Sender::Transport::SMTP->new({host => $ +SMTP_HOSTNAME,port => $SMTP_PORT}) } ); } catch { print $_->message};
In reply to Re: Email::MIME won't send email to Bcc addresses
by tobyink
in thread Email::MIME won't send email to Bcc addresses
by fshrewsb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |