FormMail

FormMail.pl is a widely used Perl script for sending the contents of web based forms to a specified email address.

You can download the latest version FormMail from http://www.scriptarchive.com/formmail.html You will find full documentation for the script at this site also.

In order to use FormMail you will need to modify the FormMail.pl script as outlined in the instructions provided here.

When uploading the FormMail.pl file to your web hosting account via ftp from a Windows or Apple computer, you will need to ensure your ftp client is set to 'ASCII' mode. The file should be placed in the 'cgi-bin' directory of your hosting account.

Once you have configured and uploaded the formmail script to your hosting account you need to insert some html to display form on the desired pages. Configuration Example

The following html is an example of the code required to generate a simple form using the FormMail.pl script.


  • <form action="/cgi-bin/FormMail.pl" method="POST">
    
    <input type="hidden" name="print_blank_fields" value="1">
    <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,">
    <input type="hidden" name="recipient" value="your@email.address.com">
    <input type="hidden" name="redirect" value="redirect-page.html">
    <input type="hidden" name="required"  value="realname">
    <input type="hidden" name="subject"  value="Email Subject line">
    
    Name: <input type="text" size="26" maxlength="64" name="realname">
    
    Phone Number: <input type="text" size="26" maxlength="64" name="phone">
    
    E-mail Address: <input type="text" size="26" maxlength="64" name="email">
    Website Address: <input type="text" size="26" maxlength="64" name="address">
    
    Comments
    <TEXTAREA name="comments" rows="4" cols="40" wrap="physical">
    </textarea>
    
    <input type="submit" name="Submit" value="Submit">
    <input type="reset" name="Reset" value="Clear Form">
    
    </form>