#!/opt/bin/perl ######################################################### # recommend.pl - web-based emailer # by Andrew B. King. v1.0 19990430 # Copyright (c) 1999 internet.com Corporation. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Originally published and documented at http://www.webreference.com # Contact aking@internet.com for all other uses. # # 03-02-99 added update newltr checkbox - abk # 030499 fixed bugs - abk (subscribe\@webreference.com didn't work in to) # 032599 formatting improved-changed to web based emailer # 042999 new ad enews cgi added - abk ########################################################### #BEGIN{ push(@INC, 'lib2', '/usr/local/lib/perl5'); } use CGI; $QUERY = new CGI; $BLANK = 'blank'; $SUBMIT = 'Send Comments'; $path = $ENV{'HTTP_REFERER'}; $endpage = '

Copyright © 1999 internet.com LLC

Script revised: Apr. 29, 1999

'; $Line1 = 'Your name: '; $Line2 = 'Your e-mail address: '; $Line3 = "Your friend's name: "; $Line4 = "Your friend's e-mail address: "; $Line5 = 'Your message: '; $Line6 = 'Referer'; $Line10 = 'Send me a copy: '; @REQUIRED = ( $Line1, $Line2, $Line3, $Line4); $data .= $QUERY->startform(undef, '/cgi-bin/recommend.cgi'); $data .= "
"; $data .= ""; $data .= ""; $data .= ""; $data .= ""; $data .= ""; $data .= ""; $data .= ""; $data .= ""; $data .= ""; $data .= ""; $data .= ""; $data .= ""; # # end form # $data .= ""; $data .= "
*$Line1".$QUERY->textfield($Line1,'',25,70)."
*$Line2".$QUERY->textfield($Line2,'',25,70)."
*$Line3".$QUERY->textfield($Line3,'',25,70)."
*$Line4".$QUERY->textfield($Line4,'',25,70)."
$Line5
$Line10".$QUERY->checkbox($Line10,1,'on',' ')."
".$QUERY->submit($SUBMIT); $data .= $QUERY->defaults('Reset'); $data .= $QUERY->hidden($Line6, $path); $data .= $QUERY->endform; $data .= "
"; $data .= $endpage; $data .= $QUERY->end_html; $SENDMAIL = '/usr/lib/sendmail -t -oi -odb'; #$SERVERNAME = $SERVER->GetServerData('servername'); # @params = $QUERY->param; # if (@params) { $errors = ''; foreach $field (@REQUIRED) { $value = $QUERY->param($field); unless ($value) { $field =~ tr/\_/ /; $errors .= "
  • The $field field was left empty."; } } if ($errors) { $heading .= qq(
    Please address the following fields and re-submit the form:
    ); } else { $yourname = $QUERY->param($Line1); $youremail = $QUERY->param($Line2); $friendsname = $QUERY->param($Line3); $friendsemail = $QUERY->param($Line4); $message = $QUERY->param(message); $cc = $QUERY->param($Line10); $cctext = ""; if ($cc eq "on") { $cctext = $youremail } open (MAIL, "|/usr/lib/sendmail -t -oi"); print MAIL<param($Line6); print $QUERY->header; print $QUERY->start_html('Tell a Friend - WebReference.com', 'aking@webreference.com', '', '', '', '', '', '', '', '', '', 'BGCOLOR="#ffffff"'); print '

    '; print '

    home / web / recommend / thanks

    '; print <Webref.com

    Another Friend?

    Thank you for recommending WebReference to $friendsemail. In a few minutes, you should also be receiving confirmation of your recommendation through e-mail. In the meantime, would you like to recommend WebReference to another friend, family member, or colleague? Just use the form below like you did before:

    E11 ; print $data; print "\n"; exit(0); } # no errors } else { # no params $heading .= <Webref.com

    Tell a Friend: with this Web-based e-mailer

    Feel free to recommend this site (and of course, the newsletter) to friends, family members, or colleagues! Feel free to send as many recommendations as you want. There's always room for another subscriber! (* = required field)

    EOT ; } $output = "Status: 200 Ok\r\n"; $output .= $QUERY->header; $output .= $QUERY->start_html('Tell a Friend - WebReference.com', 'aking@webreference.com', '', '', '', '', '', '', '', '', '', 'BGCOLOR="#ffffff"'); $output.= <
    WebReference.com HTML (daily)

    Text (weekly)
    Free HTML Newsletters
    qq ; $output .= '

    '; $output .= '

    home / web / recommend

    '; $output .= $heading; # # input data # $output .= $data; print $output; print "\n"; exit(0);