Multiple bcc recipients

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Erica

    Multiple bcc recipients

    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_sendma il/sendmail'
    $bcc = 'Bcc: xxxx@yyyyy.com, wwwww@vvvv.com, zzzzz@ttttt.com';
    $email = $debug ? $debug_email : $hash{'eMail'};
    $from = 'us@ourselves.c om';
    $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:$subj ect\n$text";
    close MAIL;

    Any help is greatly appreciated,
    Erica
  • Gunnar Hjalmarsson

    #2
    Re: Multiple bcc recipients

    Erica wrote:[color=blue]
    > 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.[/color]

    <snip>
    [color=blue]
    > $bcc = 'Bcc: xxxx@yyyyy.com, wwwww@vvvv.com, zzzzz@ttttt.com';[/color]
    --------------^^^^

    <snip>
    [color=blue]
    > print MAIL "From: $from\nBcc:$bcc \nSubject:$subj ect\n$text";[/color]
    -----------------------------^^^^

    You seem to sending:

    Bcc: Bcc: xxxx@yyyyy.com, etc.

    and 'Bcc: xxxx@yyyyy.com' is problably not a valid address.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl

    Comment

    Working...