E-Liam
05-05-2008, 12:00 PM
Hi all,
I'm trying to set up formmail on my site, but cant get it to work. I get an error 500 page instead. This is a test page with the same script, as the original has a lot of fields. If I can get this one working it should be the same for the main one???!!!
The mailtest email addy is real, but temporary, so I've left it in.
Form
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>What is your favorite animal ?</title>
<link rel="stylesheet" type="text/css" href="/css/nms.css" />
</head>
<body>
<form method="post" action="/cgi-bin/moonbug.pl">
<INPUT TYPE="hidden" NAME="recipient" VALUE="mailtest@hanworthclub.co.uk">
<input type="hidden" name="subject" value="Favorite Animal" />
<table>
<tr>
<td>What is your name ?</td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td>What is your favorite animal ?</td>
<td><input type="text" name="animal" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" /></td>
</tr>
</table>
</form>
</body>
</html>
Script (moonbug.pl)
#!/usr/bin/perl -w
##############################################################################
# nms Formmail Version 3.14c1 #
# Copyright 2001 London Perl Mongers All rights reserved #
# Created 11/11/01 Last Modified 08/11/04 #
# Matt's Script Archive: http://www.scriptarchive.com/ #
##############################################################################
# nms Formmail has been created as a drop in replacement for the FormMail #
# found at Matt's Script Archive. Both the original and nms versions of this #
# script can be found at the above URL. Support for nms Formmail is #
# available through: nms-cgi-support@lists.sourceforge.net #
##############################################################################
#
# NMS FormMail Version 3.14c1
#
use strict;
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
$address_style
);
# PROGRAM INFORMATION
# -------------------
# FormMail.pl Version 3.14c1
#
# 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
# <http://www.perl.com/pub/a/language/misc/Artistic.html>
#
# 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.
#
BEGIN
{
$DEBUGGING = 1;
$emulate_matts_code= 0;
$secure = 1;
$allow_empty_ref = 1;
$max_recipients = 5;
$mailprog = '/usr/sbin/sendmail -oi -t';
$postmaster = 'mailtest@hanworthclub.co.uk';
@referers = qw(www.hanworthclub.co.uk);
@allow_mail_to = qw(mailtest@hanworthclub.co.uk);
@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 = '';
$no_content = 0;
$double_spacing = 1;
$wrap_text = 0;
$wrap_style = 1;
$address_style = 0;
$send_confirmation_mail = 0;
$confirmation_text = <<'END_OF_CONFIRMATION';
From: you@your.com
Subject: form submission
Thank you for your form submission.
END_OF_CONFIRMATION
I set up a classified ads page on a previous incarnation, and the shebang and sendmail paths are correct.. or they used to be anyway. :thumbsup:
Cheers
Liam
I'm trying to set up formmail on my site, but cant get it to work. I get an error 500 page instead. This is a test page with the same script, as the original has a lot of fields. If I can get this one working it should be the same for the main one???!!!
The mailtest email addy is real, but temporary, so I've left it in.
Form
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>What is your favorite animal ?</title>
<link rel="stylesheet" type="text/css" href="/css/nms.css" />
</head>
<body>
<form method="post" action="/cgi-bin/moonbug.pl">
<INPUT TYPE="hidden" NAME="recipient" VALUE="mailtest@hanworthclub.co.uk">
<input type="hidden" name="subject" value="Favorite Animal" />
<table>
<tr>
<td>What is your name ?</td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td>What is your favorite animal ?</td>
<td><input type="text" name="animal" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" /></td>
</tr>
</table>
</form>
</body>
</html>
Script (moonbug.pl)
#!/usr/bin/perl -w
##############################################################################
# nms Formmail Version 3.14c1 #
# Copyright 2001 London Perl Mongers All rights reserved #
# Created 11/11/01 Last Modified 08/11/04 #
# Matt's Script Archive: http://www.scriptarchive.com/ #
##############################################################################
# nms Formmail has been created as a drop in replacement for the FormMail #
# found at Matt's Script Archive. Both the original and nms versions of this #
# script can be found at the above URL. Support for nms Formmail is #
# available through: nms-cgi-support@lists.sourceforge.net #
##############################################################################
#
# NMS FormMail Version 3.14c1
#
use strict;
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
$address_style
);
# PROGRAM INFORMATION
# -------------------
# FormMail.pl Version 3.14c1
#
# 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
# <http://www.perl.com/pub/a/language/misc/Artistic.html>
#
# 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.
#
BEGIN
{
$DEBUGGING = 1;
$emulate_matts_code= 0;
$secure = 1;
$allow_empty_ref = 1;
$max_recipients = 5;
$mailprog = '/usr/sbin/sendmail -oi -t';
$postmaster = 'mailtest@hanworthclub.co.uk';
@referers = qw(www.hanworthclub.co.uk);
@allow_mail_to = qw(mailtest@hanworthclub.co.uk);
@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 = '';
$no_content = 0;
$double_spacing = 1;
$wrap_text = 0;
$wrap_style = 1;
$address_style = 0;
$send_confirmation_mail = 0;
$confirmation_text = <<'END_OF_CONFIRMATION';
From: you@your.com
Subject: form submission
Thank you for your form submission.
END_OF_CONFIRMATION
I set up a classified ads page on a previous incarnation, and the shebang and sendmail paths are correct.. or they used to be anyway. :thumbsup:
Cheers
Liam