#!/usr/local/bin/perl #Change this line to point to your version of perl require "cgi-lib.pl"; #YOU MUST have this program (cgi-lib.pl) installed to run this mailer! #simple mailing program # by Andy Harris, 4/1/97 #expects a form with a hidden field called recipient #and a field called subject which can be hidden or text #this field should have the name of the person who is being mailed to. #one more field called message should have the main body of the message #get input from form &ReadParse(*input); #set up constant for mail program. Change this to point to your version #of sendmail $mailprog = '/usr/lib/sendmail'; #get recipient from form $recipient = $input{'recipient'}; #get subject from form $subject = $input{'subject'}; #if ($subject eq ""){ # $subject = "generic form reply"; #} #get the message $message = $input{'message'}; #send the mail open (MAIL, "|$mailprog $recipient") || die ("couldn't open $mailprog! \n"); print MAIL "Subject: $subject \n\n"; print MAIL 'Message: \n'; print MAIL $message . "\n \n"; print MAIL "(sent by wrMail, Andy Harris, 1997)"; print MAIL "\n \n"; close (MAIL); #send a response to the user print &PrintHeader; print "