The form mail script collects the data submitted in a form, (optionally) formats it, and sends it to one or more email addresses. For more information on form mail scripts and a list of free form mail scripts see Some form mail script examples.
This page explains the usage of Perl based, NMS FormMail.
Using the form mail script
This guide takes you step by step through creating a form and getting the form submissions by email.
Step 1: Download the form mail script
Download the script from http://nms-cgi.sourceforge.net/scripts.shtml Download the TFMail package from the page and unzip it.
Step 2: Modify the script
Now you have to modify the script that you had downloaded in step 1. Open the TFMail.pl in a text editor and update the script. Instead of 'johnd' it will be your user name. Depending on your hosting account, the actual path can vary.
Note: Important! do not put the configuration files in a location that could be accessed from the web.
Step 3: Update the configuration file
open the default.trc file (from the downloaded files in step 1) save it as say, feedback.trc
Edit feedback.trc and change recipient to your email address.
Step 4: Upload the files
Login to your web server through FTP.
Create a folder tfmail in the base folder Note: Important! do not put the configuration files in a location that could be accessed from the web.- Upload the following files to the tfmail folder
- feedback.trc (created in step 3)
- Upload the TFmail.pl to the cgi-bin folder. Update the file permissions of TFmail.pl to 755
Step 5: Create the form
Use an HTML editor to create the form
The code for a sample form is given below:
<form name='feedback' method='POST' action='/cgi-bin/TFmail.pl' accept-charset='UTF-8'> <input type='hidden' name='_config' value='feedback' /> Name: <br> <input type='text' name='Name' size='20'/><br> Email: <br> <input type='text' name='Email' size='20'/><br> Comments: <br> <textarea name='Comments' cols='50' rows='8'></textarea><br> <br> <input type='submit' name='Submit' value='Submit'/> </form>
Upload the page containing the form also to the web server
Step 6: Test the form!
Open the form page and submit some sample data.