Created
July 12, 2020 16:30
-
-
Save nikdoof/8235de469d78a00cfb770e4dd0ed1738 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/perl | |
# Basic mailer/bug report perl | |
# Copyright [email protected] 1999 | |
require "cgi-lib.pl"; | |
# change this to the location of sendmail on your system | |
# this should be standard for linux | |
$SENDMAIL = "/usr/lib/sendmail -t"; | |
# change this to the recipient | |
$RECIPIENT = '[email protected]'; | |
print "Content-type: text/html\n\n"; | |
print "<html>\n"; | |
print "<head>\n"; | |
# read all the inputted stuff from the form and shove them into | |
# a string called 'values' | |
&ReadParse(*values); | |
#Use the information | |
#check to see if all the fields are there | |
if ((! $values{"name"}) || | |
(! $values{"email"}) || | |
(! $values{"comments"}) || | |
($values{"comments"} eq "TYPE COMMENT HERE")) | |
{ | |
print "<title>Please fill out all the fields</title>\n"; | |
print "</head>\n"; | |
print "<h1>Please fill out all the fields</h1>\n"; | |
print "Please fill out the name, email address, comments\n"; | |
print "Back up to the previous page to try again.\n"; | |
print "</body></html>\n"; | |
exit 0; | |
} | |
#everything chesk okay mail it! | |
$fname = "|" . $SENDMAIL; | |
open(OUT, $fname); | |
print OUT "To: ", $RECIPIENT, "\n"; | |
print OUT "From: ", $values{"name"}, " <", $values{"email"}, ">\n"; | |
print OUT "Subject: comments/bug report\n"; | |
print OUT "\n"; | |
print OUT $values{"comments"}, "\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 "<title>Thank you, ", $values{"name"}, "</title>\n"; | |
print "</head>\n"; | |
print "<h1>Thank you, ", $values{"name"}, "</h1>\n"; | |
print "Thank you for your report.\n"; | |
print "</body></html>\n"; | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment