Matts Script - FormMail - help! (beginner)
I've been round and round with the Tech Support with this one. Please keep in mind I've never touched perl/cgi and I'm a beginner and know nothing beyond HTML/CSS...
I'm trying to set up this script to email me whatever information is entered in my form...that's how it's supposed to work, right?
I keep getting an INTERNAL SERVER ERROR about Misconfiguration, and I can't figure out what I'm doing wrong.
I am using:
on the page:
I want it to send that information to my email, and then refresh to the page
http://www.stevedolan.com/contact_thx.html When complete.
First I figured out that I didn't have it set to chmod 755, now I do...then I was told by support that the "formatting of my file was wrong"
I've downloaded "Perl Express" since I guess Dreamweaver doesn't edit perl?
Can someone help me out please? I feel like I've followed the directions to the letter and I have no Idea why I'm coming up with errors.
Thanks so much for your time and attention.
Last edited by scribblesteve; 02-24-2009 at 09:11 PM.
OK, we'll check 1) your FormMail script and 2) if you can run perl at all.
Ad 1) Please open your FormMail.pl script in notepad or another plain text editor, copy the entire content and paste it here as a reply. Please surround the code in [CODE] ... [/CODE] tags, so the formatting doesn't break.
I or somebody else will look at the code and see if there are any errors.
Ad 2) With a plain text editor, create a file named for example "test.pl". Enter into it:
Upload the file on your server to the same directory where FormMail.pl resides, chmod it to 755 and request the file in your browser (same URL as to FormMail.pl but with test.pl instead).
$| = 1;
print "Content-type: text/html\n\n";
print "We are running perl version $]\n";
Post here what you get (again inside [CODE][/CODE] pls).
That should give us some insight into what's going wrong.
Ok, here is all I touched on this FormMail.pl script. The actual script is about 2700 lines long, I dont think you need all of that...I've posted below everything I touched:
# NMS FormMail Version 3.12c1
use vars qw(
$DEBUGGING $emulate_matts_code $secure %more_config
$allow_empty_ref $max_recipients $mailprog @referers
@allow_mail_to @recipients %recipient_alias
@valid_ENV $date_fmt $style $send_confirmation_mail
$confirmation_text $locale $charset $no_content
$double_spacing $wrap_text $wrap_style $postmaster
# PROGRAM INFORMATION
# FormMail.pl Version 3.12c1
# This program is licensed in the same way as Perl
# itself. You are free to choose between the GNU Public
# License <http://www.gnu.org/licenses/gpl.html> or
# the Artistic License
# For help on configuration or installation see the
# README file or the POD documentation at the end of
# this file.
# USER CONFIGURATION SECTION
# Modify these to your own settings. You might have to
# contact your system administrator if you do not run
# your own web server. If the purpose of these
# parameters seems unclear, please see the README file.
$DEBUGGING = 0;
$secure = 1;
$allow_empty_ref = 1;
$max_recipients = 2;
$mailprog = '/usr/sbin/sendmail -oi -t';
$postmaster = 'email@example.com';
@referers = qw(www.stevedolan.com);
@allow_mail_to = qw(firstname.lastname@example.org);
@recipients = ();
%recipient_alias = ();
@valid_ENV = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT);
$locale = '';
$charset = 'iso-8859-1';
$date_fmt = '%A, %B %d, %Y at %H:%M:%S';
$style = 'http://www.stevedolan.com/css/5.css';
$no_content = 0;
$double_spacing = 1;
$wrap_text = 0;
$wrap_style = 1;
$send_confirmation_mail = 0;
$confirmation_text = <<'END_OF_CONFIRMATION';
Subject: My Contact Form
Thank you for contacting me, I have recieved your submittion and will respond accordingly. I hope all is well with you and yours.
# You may need to uncomment the line below and adjust the path.
# use lib './lib';
# USER CUSTOMISATION SECTION
# Place any custom code here
# USER CUSTOMISATION << END >>
# (no user serviceable parts beyond here)
# The code below consists of module source inlined into this
# script to make it a standalone CGI.
# Inlining performed by NMS inline - see /v2/buildtools/inline
# in CVS at http://sourceforge.net/projects/nms-cgi for details.
(and the code continues)
And for the Test.pl thing you had me try, I this is what I got when I requested that page, which happens to be the same exact error I get with this form:
I should mention though, that I was in contact with my host Tech Support, and they said that they "fixed" the problem, and I still need to do some configuration -
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, email@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/126.96.36.19935 Server at www.stevedolan.com Port 80
When I checked after they fixed it, the submit button processed correctly, but redirected to the incorrect page (no errors), yet I didn't receive any emails. When I attempted (poorly) to correct the problem, I kept ending up with the Internal Server Error.
I hope that helps in some way. Thanks for your time, I really appreciate it.
The code you posted seems OK -- but without the whole thing, it's impossible to say what could be wrong.
The weirder thing is that my testing script ends with server error. I tested it, it should work and print the perl version. Its not working shows that there is really some misconfiguration -- please double check if the execute permissions are set and if you copied the code exactly. If so, then it may be time to ask the tech support again why this minimalistic script is not running. When we get to make that work, we may go on searching for the cause of the formmail malfunction. If not even the minimal script runs OK, nothing bigger likely will.
Here's an Update...
I've been in contact with my Hosting company tech support - and I got this email back from them:
Now the form looks like it processes correctly, and ends up at the right landing page - but now - I'm not receiving the information, it's not being emailed properly.
There was a syntax error in the FormMail.pl file.
sudo -u scribble ./FormMail.pl
audit_log_user_command(): Connection refused
Array found where operator expected at ./FormMail.pl line 48, at end of line
syntax error at ./FormMail.pl line 48, near "scribblesteve@gmail"
Global symbol "@gmail" requires explicit package name at ./FormMail.pl line 48.
BEGIN not safe after errors--compilation aborted at ./FormMail.pl line 80.
I thought this was supposed to be a simple, easy script....
For the interested - here is a link to the entire script - It's too long to post here:
Last edited by scribblesteve; 02-26-2009 at 10:34 AM.
The syntax error they report does not fit. There must be something more profound going on. Please, try to make them help you get the minimal test script running -- since it throws an internal server error, there must be an error elsewhere than in the script itself.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)