Multiple bcc recipients

Discussion in 'Perl' started by Erica, Oct 6, 2003.

  1. Erica

    Erica Guest

    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: , , ';
    $email = $debug ? $debug_email : $hash{'eMail'};
    $from = '';
    $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
     
    Erica, Oct 6, 2003
    #1
    1. Advertising

  2. Erica wrote:
    > 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.


    <snip>

    > $bcc = 'Bcc: , , ';

    --------------^^^^

    <snip>

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

    -----------------------------^^^^

    You seem to sending:

    Bcc: Bcc: , etc.

    and 'Bcc: ' is problably not a valid address.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Oct 6, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. .Net Newbie

    Single email to multiple recipients

    .Net Newbie, Jun 30, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    9,445
    .Net Newbie
    Jul 1, 2004
  2. Alex Hunsley
    Replies:
    2
    Views:
    899
    Paul Wright
    Jul 1, 2004
  3. Replies:
    1
    Views:
    404
    Rene Pijlman
    Feb 20, 2006
  4. John Bailo

    JavaMail multiple recipients

    John Bailo, Jul 25, 2006, in forum: Java
    Replies:
    2
    Views:
    32,901
    philmin
    Jun 30, 2010
  5. Erica Coffin

    Sendmail BCC with multiple recipients

    Erica Coffin, Oct 6, 2003, in forum: Perl Misc
    Replies:
    4
    Views:
    582
    James Willmore
    Oct 7, 2003
Loading...

Share This Page