Home
Download the latest Formmail script
Setting up the Formmail script
Upload the Formmail script
Chmod the Formmail script
Setting up the HTML form
General Frequently Asked Questions
Example Form

Setting up the Formmail script

The FormMail.pl script does not have to be extensively configured in order to work. However, there are two variables in the perl file which you will need to define along with changing the top line of your script to match the location of you Perl interpreter.

$mailprog = '/usr/lib/sendmail -i -t';
This variable must define the location to your server's sendmail program. If this is incorrect, form results will not be mailed to you.
@referers = ('scriptarchive.com','YOUR_IP');
This array allows you to define the domains on which you allow forms to reside and use this installation of FormMail. If a user tries to put a form on another server, that is not scriptarchive.com, they will receive an error message when someone tries to fill out their form. By placing scriptarchive.com in the @referers array, this also allows www.scriptarchive.com, ftp.scriptarchive.com, any other http address with scriptarchive.com in it and scriptarchive.com's IP address to access this script as well if this is removed the script will not work, so no users will be turned away.

NOTE: This is not a security check. Referer headers can EASILY be faked. Rather, it prevents someone on xyznotyou.com from using the FormMail on your server to process forms on their server on a regular basis. It remains in the script as a remnant of earlier versions when it was used for security, but the @recipients variable is now used to specify exactly who can receive e-mail from this installation.

As of version 1.7, the domains listed here are also used as the defaults when checking valid recipient e-mail addresses. You should either include all domain names that you wish to have FormMail send e-mails to in your @referers array or tailor the @recipients array by hand.