#!/usr/bin/perl use Socket; $|=1; ################################################################## # birdcast.cgi Version 2.1 # updated Nov 2, 2002 # (C)1998-2002 Bignosebird.com # This software is FREEWARE! Do with it as you wish. It is yours # to share and enjoy. Modify it, improve it, and have fun with it! # It is distributed strictly as a learning aid and bignosebird.com # disclaims all warranties- including but not limited to: # fitness for a particular purpose, merchantability, loss of # business, harm to your system, etc... ALWAYS BACK UP YOUR # SYSTEM BEFORE INSTALLING ANY SCRIPT OR PROGRAM FROM ANY # SOURCE! ################################################################## # CONFIGURATION NOTES # # $SCRIPT_NAME is the full URL of this script, including the # http part, ie, "http://domainname.com/cgi-bin/birdcast.cgi"; # # $SITE_NAME is the "name" of your web site. # $SITE_URL is the URL of your site (highest level) # $END_LINE is the very last line printed in the e-mail. # # $MAXNUM is the number of possible people a person can refer # your URL to at one time. If you call the script using the # GET method, then this is also the number of entry blanks # created for recipient names and addresses. # # $SMTP_SERVER is the name of your e-mail gateway server, or # SMTP host. On most systems, "localhost" will work just fine. # If not, change "localhost" to whatever your ISP's SMTP # server name is, ie, smtp.isp.net or mail.isp.net # $SEND_MAIL is the full path to your server's sendmail program # If you do not wish to use Sockets for some reason and need # to use sendmail, uncomment the $SEND_MAIL line and comment # the $SMTP_SERVER line. # okaydomains is a list of domains from which you want to allow # the script to be called from. Leave it commented to leave the # script unrestricted. If you choose to use it, be sure to list # your site URL with and without the www. # Use either $SMTP_SERVER $SMTP_SERVER="smtp.1and1.com"; # # OR # # $SEND_MAIL="/usr/lib/sendmail -t"; # # BUT NEVER BOTH!!!!!! @okaydomains=("http://wirehomedecor.com", "http://www.wirehomedecor.com"); $SCRIPT_NAME="http://www.wirehomedecor.com/recommendation/birdcast.cgi"; $SITE_NAME="Wire Home Decor"; $SITE_URL="http://www.wirehomedecor.com/"; $ENDLINE=""; $MAXNUM=2; $LOGFILE="recommendations.txt"; if ($SENDMAIL ne "") {&test_sendmail;} &valid_page; #if script is called from offsite, bounce it! &decode_vars; if ( $ENV{'REQUEST_METHOD'} ne "POST") { &draw_request; exit; } &do_log; &process_mail; # print "Location: $JUMP_TO\n\n"; &sent_page; ################################################################## sub process_mail { for ($i=1;$i<$MAXNUM+1;$i++) { $recipname="recipname_$i"; $recipemail="recipemail_$i"; if ($fields{$recipemail} eq "") { next; } if (&valid_address == 0) { next; } #BNB SAYS! You can modify the Subject line below. $subject = "Suggestion from $fields{'send_name'}"; #BNB SAYS! Modify the lines below between the lines marked # with __STOP_OF_MAIL__ to customize your e-mail message # DO NOT remove the lines that contain __STOP_OF_MAIL__! # If you enter any hardcoded e-mail addresses, BE SURE TO # put the backslash before the at sign, ie, me\@here.net $msgtxt = <<__STOP_OF_MAIL__; Hi $fields{$recipname}, $fields{'send_name'} was just looking at the products on $SITE_NAME and suggested that you see the following: $JUMP_TO We sell unique products that will meet your needs. They are all hand crafted in the unted states and we pride ourselves on quality customer service. Feel free to order online today and take advantage of our fast shipping or contact us personally with your questions. Sincerely, Alton & BreAna Alexander __STOP_OF_MAIL__ $msgtxt .= "$SITE_URL\n\n"; $msgtxt .= "$ENDLINE\n"; if ($fields{'message'} ne "") { $msgtxt .= "P.S. Here is their personal message to you....\n"; $msgtxt .= "$fields{'message'}\n\n"; } $mailresult=&sendmail($fields{send_email}, $fields{send_email}, $fields{$recipemail}, $SMTP_SERVER, $subject, $msgtxt); if ($mailresult ne "1") {print "Content-type: text/html\n\n"; print "MAIL NOT SENT. SMTP ERROR: $mailresult\n"; exit } } } ################################################################## sub draw_request { print "Content-type: text/html\n\n"; #BNB SAYS! Here is the part that draws the page that asks the #reader to enter e-mail addresses and names. Tailor it to meet # your needs if necessary. DO NOT disturb the lines with # __REQUEST__ on them. print <<__REQUEST__;
Recommend this link to one or more friends and include yourself if you want to receive an email reminder! |
SENT, THANK YOU.