I am beyond frustrated. I tried to design my 2nd mail form in perl since my first one was so messed up. This one is a millions times more basic than my last one yet NO ONE in chatrooms know what is wrong.
I do not get a real error, just a normal ISE (internal server error) or a misconfiguration. It is setup in my cgi bin and chmoded to 755. It is linked properly from my form. Sendmail is correct too.
Some people say it works for them, other people say it does. I have NO clue why this is.
What is weird, I still get emails sometimes when the form is used even though it gives an error message. Sometimes it doesn't email me, just gives an error. What is real wierd is if the person types in something like 'aaa' in the email field it shows aaa@ in the FROM when I get the email. Inoverse is my webhost and NO WHERE in the script below do I tell it to have anything to do with them.
Can anyone see the problem with the script below?
Thanks millions!
Guest101
#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
#if ($ENV{'REQUEST_METHOD'} eq 'POST') {
# read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
#} else {
# $buffer = $ENV{'QUERY_STRING'};
#}
#@pairs = split(/&/, $buffer);
#foreach $pair (@pairs) {
# ($name, $value) = split(/=/, $pair);
# $name =~ tr/+/ /;
# $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
# $value =~ tr/+/ /;
# $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
# $FORM{$name} = $value;
# }
######################################################################
##########################VARIABLES/MUST EDIT########################
# Change to your full name
$webmastername = 'Name Of Webmaster';
# Change with your email account
$adminemail = 'sulfericacid@qwest. net';
# Change to correct path of sendmail
#$sendmail = '/usr/sbin/sendmail';
# Change to email subject for email to visitor. Ie. "Thanks for your submission"
$subject = 'Enter Subject Here';
# Change to email subject for email to you. Ie. "Someone used your form"
$subject2 = 'Enter Subject Here';
# Change to message you want emailed to visitor. Ie. "Your submission was recieved. Site features, etc."
$message = 'Personalized message';
# Homepage url, do not link to form, use your index. Ie. " submission.com"
$homepage = 'url of homepage';
# Change to enclosure. Ie. "Sincerly yours"
$thanks = 'Personalized thank you or please come again';
# Change to title of thank you page. Ie. "Form processed and received"
$title = 'Title of End page';
######################################################################
#######################EMAIL TO VISITOR/DON'T EDIT######################
#open(MAIL,"|$sendmail -t"
print MAIL "To: ($FORM{'recipientemail'})\n";
print MAIL "From: $adminemail\n";
print MAIL "Subject: $subject\n";
print MAIL "($FORM{'visitorname'})\n";
print MAIL "$message\n";
print MAIL "$thanks\n";
print MAIL "$webmastername\n";
print MAIL "mailto:$adminemail\n";
print MAIL "$homepage\n";
close(MAIL);
######################################################################
#######################EMAIL TO ADMIN/DON'T EDIT#######################
#open(MAIL,"|$sendmail -t"
print MAIL "To: $adminemail\n";
print MAIL "From: ($FORM{'recipientemail'})\n";
print MAIL "Subject: $subject2\n";
print MAIL "($FORM{'visitorname'})\n";
print MAIL "($FORM{'recipientemail'})";
print MAIL "($FORM{'weburl'})";
print MAIL "$(FORM{'message'})";
close(MAIL);
######################################################################
########################PRINT THANK YOU/MUST EDIT#####################
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>$title</TITLE>\n";
print "</HEAD>\n";
print "<BODY>\n";
print "<p>Thank you for your message. If you are waiting for a response, please allow upto 24 hours.</p>\n";
print "</BODY>/n";
print "</HTML>/n";
I do not get a real error, just a normal ISE (internal server error) or a misconfiguration. It is setup in my cgi bin and chmoded to 755. It is linked properly from my form. Sendmail is correct too.
Some people say it works for them, other people say it does. I have NO clue why this is.
What is weird, I still get emails sometimes when the form is used even though it gives an error message. Sometimes it doesn't email me, just gives an error. What is real wierd is if the person types in something like 'aaa' in the email field it shows aaa@ in the FROM when I get the email. Inoverse is my webhost and NO WHERE in the script below do I tell it to have anything to do with them.
Can anyone see the problem with the script below?
Thanks millions!
Guest101
#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
#if ($ENV{'REQUEST_METHOD'} eq 'POST') {
# read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
#} else {
# $buffer = $ENV{'QUERY_STRING'};
#}
#@pairs = split(/&/, $buffer);
#foreach $pair (@pairs) {
# ($name, $value) = split(/=/, $pair);
# $name =~ tr/+/ /;
# $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
# $value =~ tr/+/ /;
# $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
# $FORM{$name} = $value;
# }
######################################################################
##########################VARIABLES/MUST EDIT########################
# Change to your full name
$webmastername = 'Name Of Webmaster';
# Change with your email account
$adminemail = 'sulfericacid@qwest. net';
# Change to correct path of sendmail
#$sendmail = '/usr/sbin/sendmail';
# Change to email subject for email to visitor. Ie. "Thanks for your submission"
$subject = 'Enter Subject Here';
# Change to email subject for email to you. Ie. "Someone used your form"
$subject2 = 'Enter Subject Here';
# Change to message you want emailed to visitor. Ie. "Your submission was recieved. Site features, etc."
$message = 'Personalized message';
# Homepage url, do not link to form, use your index. Ie. " submission.com"
$homepage = 'url of homepage';
# Change to enclosure. Ie. "Sincerly yours"
$thanks = 'Personalized thank you or please come again';
# Change to title of thank you page. Ie. "Form processed and received"
$title = 'Title of End page';
######################################################################
#######################EMAIL TO VISITOR/DON'T EDIT######################
#open(MAIL,"|$sendmail -t"
print MAIL "To: ($FORM{'recipientemail'})\n";
print MAIL "From: $adminemail\n";
print MAIL "Subject: $subject\n";
print MAIL "($FORM{'visitorname'})\n";
print MAIL "$message\n";
print MAIL "$thanks\n";
print MAIL "$webmastername\n";
print MAIL "mailto:$adminemail\n";
print MAIL "$homepage\n";
close(MAIL);
######################################################################
#######################EMAIL TO ADMIN/DON'T EDIT#######################
#open(MAIL,"|$sendmail -t"
print MAIL "To: $adminemail\n";
print MAIL "From: ($FORM{'recipientemail'})\n";
print MAIL "Subject: $subject2\n";
print MAIL "($FORM{'visitorname'})\n";
print MAIL "($FORM{'recipientemail'})";
print MAIL "($FORM{'weburl'})";
print MAIL "$(FORM{'message'})";
close(MAIL);
######################################################################
########################PRINT THANK YOU/MUST EDIT#####################
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>$title</TITLE>\n";
print "</HEAD>\n";
print "<BODY>\n";
print "<p>Thank you for your message. If you are waiting for a response, please allow upto 24 hours.</p>\n";
print "</BODY>/n";
print "</HTML>/n";