Fermilab Computing Division
Fermilab Homepage Computing Division Homepage Computing Division Banner

FormMail at Fermilab

FormMail is a Perl script which takes information from an html form and sends it as email. It is a standard form written by Matt Wright and obtainable as freeware. We have made a few modifications to it to suit our needs here at Fermilab. One of these modifications is that you cannot send email to an offsite address from a form. This is to prevent a spammer from using the form for that purpose. We would like all persons who need form to mail functionality to use the same fnalformmail.pl CGI for it so it can be updated in one place for functionality and security changes if needed. You can use the Fermilab script by using this action in your HTML form:

<FORM ACTION="http://www.fnal.gov/cgi-bin/formmail/fnalformmail.pl" METHOD="POST">

In addition to using the above form action, you also need submit a helpdesk request to get your web server on the list of servers ("referers") that are allowed to to use Fermilab's central formmail CGI script. If your web server is not on this list, your form will not work. Instead you will get an error saying you are not allowed to access this CGI script and you need to add your server to the @referers array.

Documentation on using formmail is available at:

formmail.INSTRUCTIONS (see the "Form Configuration" section)

The version of formmail we are using (bformmail) also can save the submitted form information to a file in a delimited format suitable for loading into a database or spreadsheet. The added features are described below. See the BFormMail Overview and then the BFormMail.readme file. In addition to bformmail features, Fermilab added a "replyto" field so you can designate who should be listed in the reply field when someone replies to an e-mail sent by formmail.

bformmail information

For examples: Many of the Computing Division forms use FormMail. Also see the testFM.html and testBFM.html examples linked on the "bformmail information" page and this sample form:

The home page for formmail and related information is at:

Matt's Script Archive: FormMail
 This page rendered in 0.3668 seconds