Click to See Complete Forum and Search --> : Making this script send me a BCC


Duke Will
08-07-2003, 10:00 AM
I am using Birdcast.cgi script from BigNoseBird.com for a refer-a-friend script. I need for it to send me an email when someone uses it. Or a BCC. Here is the the actual script shown (http://www.bignosebird.com/carchive/birdcast/birdcast.txt) . Any idea how to do this?

goofball
08-08-2003, 09:25 AM
see the part that says:

print MAIL "To: $to\n";
print MAIL "From: $fromaddr\n";
print MAIL "Reply-to: $replyaddr\n" if $replyaddr;
print MAIL "X-Mailer: Perl Powered Socket Mailer\n";
print MAIL "Subject: $subject\n\n";
print MAIL "$message";
print MAIL "\n.\n";

Just add this line:

print MAIL "To: $to\n";
print MAIL "Bcc: you\@yourdomain.com\n";
print MAIL "From: $fromaddr\n";
print MAIL "Reply-to: $replyaddr\n" if $replyaddr;
print MAIL "X-Mailer: Perl Powered Socket Mailer\n";
print MAIL "Subject: $subject\n\n";
print MAIL "$message";
print MAIL "\n.\n";

Duke Will
08-08-2003, 09:46 AM
Thanks! What you suggested is EXACTLY what was suggested to me by a programmer. It didn't work. Then, he made it work. Here's what he did...

Here's what I added to the bottom of that routine:

open (MAIL2,"| $SEND_MAIL");
print MAIL2 "To: name\@domain.com\n";
print MAIL2 "From: $fromaddr\n";
print MAIL2 "Subject: $subject (Birdcast Email)\n\n";
print MAIL2 "Sent to: $to\n$message";
print MAIL2 "\n.\n";
close(MAIL2);

(substituting my email address for that part in line 2)