#!/usr/local/bin/perl require "cgi-lib.pl"; #Change this path if this is not the location of sendmail on your system $SENDMAIL = "/lib/sendmail -t"; #Change this to your email address. Single quotes used to avoid #interpretation of the @ sign by Perl. $RECIPIENT = 'boutell@boutell.com'; print "Content-type: text/html\n\n"; print "\n"; print "\n"; #Parse the form arguments. Indicate that we want #the results to appear in "values". &ReadParse(*values); #Use the information #If any field is missing, complain! if ((! $values{"name"}) || (! $values{"email"}) || (! $values{"bug"}) || (! $values{"system"}) || (! $values{"version"}) || ($values{"system"} eq "PLEASE CHOOSE ONE") || ($values{"version"} eq "PLEASE CHOOSE ONE")) { print "Please fill out all the fields\n"; print "\n"; print "

Please fill out all the fields

\n"; print "Please fill out the name, email address, software version,\n"; print "system, and bug report fields. Back up to the previous page\n"; print "to try again.\n"; print "\n"; exit 0; } #OK, we have all the data. Open a pipe to the sendmail program. $fname = "|" . $SENDMAIL; open(OUT, $fname); print OUT "To: ", $RECIPIENT, "\n"; print OUT "From: ", $values{"name"}, " <", $values{"email"}, ">\n"; print OUT "Subject: bug report\n"; print OUT "\n"; print OUT "This bug report was submitted via the WWW-Email gateway.\n"; print OUT "--\n\n"; print OUT "System: ", $values{"system"}, "\n"; print OUT "Version: ", $values{"version"}, "\n"; print OUT $values{"bug"}, "\n"; close(OUT); print "Thank you, ", $values{"name"}, "\n"; print "\n"; print "

Thank you, ", $values{"name"}, "

\n"; print "Thank you for your bug report.\n"; print "\n"; exit 0;