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. Advertisements

  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. Advertisements

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,654
    .Net Newbie
    Jul 1, 2004
  2. Alex Hunsley
    Replies:
    2
    Views:
    987
    Paul Wright
    Jul 1, 2004
  3. Replies:
    1
    Views:
    523
    Rene Pijlman
    Feb 20, 2006
  4. John Bailo

    JavaMail multiple recipients

    John Bailo, Jul 25, 2006, in forum: Java
    Replies:
    2
    Views:
    34,412
    philmin
    Jun 30, 2010
  5. news.microsoft.com

    ASPEmail to send to multiple recipients?

    news.microsoft.com, Dec 8, 2003, in forum: ASP General
    Replies:
    15
    Views:
    522
    Roland Hall
    Dec 10, 2003
  6. dmiller23462

    Multiple Email Recipients depending on Value

    dmiller23462, Oct 28, 2004, in forum: ASP General
    Replies:
    4
    Views:
    395
    dmiller23462
    Nov 16, 2004
  7. Logesh Subramani

    Sending email to multiple recipients

    Logesh Subramani, Aug 5, 2008, in forum: Ruby
    Replies:
    1
    Views:
    239
    James Britt
    Aug 5, 2008
  8. Erica Coffin

    Sendmail BCC with multiple recipients

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