"mailform" Documentation

mailform is a PERL script which will process any form (see example) and mail the contents of the filled out form in a format which is both human and script readable. The address to which the contents are sent is contollable with hidden fields in the form.

Any field with data, with certain exceptions described below, is processed and included in the body of the mail message in the following way (not necessarily exactly in this order):

  1. Convert HTML special characters to printable form.
  2. Print the field name, followed by a colon and a space.
  3. If field data contains an ASCII LF, insert an LF at the beginning and add two spaces after all LF's in the data. This causes it to be indented when viewed, making it distinguishable from the following fields for scripts, and making it more readable for human viewers.
  4. The field data is then printed after the field name.
Certain fields are handled as special cases, and these are described as follows:
form-addr DISABLED
This should be a hidden field whose value is the email address to which the form contents are to be mailed. If form-table is also specified, the results are indeterminant. Spammers have learned to abuse the script, so I'm afraid this feature has been disabled. You'll have to use form-table from now on, or better yet, use a more modern, robust script --- this one was written over 10 years ago in the earliest days of the web.
form-table
This should be a hidden field. The value is a keyword which should match an entry in a table (by default, /var/httpd/form.tbl). The format of form.tbl is keyword:email address. The contents of the form will be mailed to the email address from the table entry whose keyword matches that of the form-table field. If no match is found, an error is displayed.
name
If the name field is present, its value will be placed in the full name portion of the From: header of the mail message when it is sent. The From: Full Name <email_address> form will be used.
email
If the email field is present, its value will be placed in the address portion of the From: header of the mail message when it is sent. The From: Full Name <email_address> form will be used.
subject
if the subject field is present, its value will be placed in the Subject: header of the mail message when it is sent.
debug
Normally, if a field has no value associated with it, the field name is not sent in the mail message. If debug has a value of on, all fields in the form will be included in the mail message, whether they have a value or not.
The mailform script will send back a message of "Thanks for the input!" to the user.


Original: 1994/11/28
Last: 2006/08/23