CGI Script - Mailform

Mailform is a free CGI script which you can install onto your account via the "CGI Scripts" page in your site's Control Panel. The script takes the input of a form and converts it to an e-mail. This document describes how to configure your HTML pages for use with Mailform.

The Mailform script resides in your cgi-bin directory, reference the script in the action tag of your HTML form as illustrated below:

This code calls the preinstalled script when the web page visitor clicks the 'Submit' button. If you are using the form to email gateway to process sensitive data from a secure form, please see the notes on invoking secure transactions.

Simply add fields to your form to yield the desired functions. Below is a list of form fields you can use and how to implement them. For full usage information, please see the README file

Field Description
recipient This form field allows you to specify where your form results will be mailed. Most likely you will want to configure this option as a hidden form field with a value equal to that of your email address.
Note that due to problems with security, you must create a file in your home directory (eg /home/m/y/myaccount/) called mailform.txt which contains a list of allowed recipients seperated by new-lines. If the recipient specified in the form is not in this file, the email will be rejected. An example of a valid mailform.txt file is:
my.name@my.domain.com
test@foo.co.uk
bar@fred.org
  
subject The subject field allows you to specify the subject that you wish to appear in the email that is sent to you after the form has been filled out.
email This form field allows the user to specify their return email address. This will be put into the 'from' field of the message you receive. If you want to require an email address with valid syntax, add this field name to the 'required' field.
realname The realname form field will allow the user to input their real name. This field is useful for identification purposes and will also be put into the 'from' line of your message header.
redirect If you wish to redirect the user to a different URL, rather than having them see the default response to the fill-out form, you can use this hidden variable to send them to a pre-made HTML page.
required You can require certain fields in your form to be filled in before the user can successfully submit the form. Simply place all field names that you want to be mandatory into this field separated by commas. If the required fields are not filled in, the user will be notified of what they need to fill in, and a link back to the form they just submitted will be provided. To use a customised error page, see 'missing_fields_redirect'.
missing_fields_redirect This form field allows you to specify a URL to which users will be redirected to if there are fields listed in the required form field that are not filled in. This allows you to customise the error page instead of displaying the default.

Any fields which you include that are not listed above will be mailed to the recipient in the body of the email.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

CGI Scripts

Our UNIX servers have the capability to run CGI scripts written in Perl. There are a number of...

Free CGI Scripts

There are a number of CGI scripts offered free of charge which you can install automatically...

CGI Script - Counter

Counter is a free CGI script which you can install onto your account via the CGI Scripts page....

Unix SSL

Secure Socket Layer (SSL) allows a secure communication channel to be set up between the server...

mySQL

mySQL is a powerful database engine which can be integrated into your web site using a...