Multiple bcc recipients

E

Erica

This has been hanging over my head for months, so I hope it's not
something silly.

I've created a Perl script where I have to send an email with multiple
bcc's via sendmail. If I have one bcc recipient the script works, but
with more than one no messages get sent to any of the bcc recipients
though the message gets to the real recipient just fine. Also, if I
copy and paste the same headers into sendmail run from the command
line that I created with the script, that works fine too.

Here's the salient part of the script:

$sendmail = 'path_to_sendmail/sendmail'
$bcc = 'Bcc: (e-mail address removed), (e-mail address removed), (e-mail address removed)';
$email = $debug ? $debug_email : $hash{'eMail'};
$from = '(e-mail address removed)';
$subject = 'You and your poodle';
$text = 'blah blah blah';
open MAIL, "|$sendmail $email"
or die "Unable to start sendmail:$!\n";
print MAIL "From: $from\nBcc:$bcc\nSubject:$subject\n$text";
close MAIL;

Any help is greatly appreciated,
Erica
 
G

Gunnar Hjalmarsson

Erica said:
I've created a Perl script where I have to send an email with
multiple bcc's via sendmail. If I have one bcc recipient the script
works, but with more than one no messages get sent to any of the
bcc recipients though the message gets to the real recipient just
fine.

$bcc = 'Bcc: (e-mail address removed), (e-mail address removed), (e-mail address removed)';
--------------^^^^

print MAIL "From: $from\nBcc:$bcc\nSubject:$subject\n$text";
-----------------------------^^^^

You seem to sending:

Bcc: Bcc: (e-mail address removed), etc.

and 'Bcc: (e-mail address removed)' is problably not a valid address.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top