HCI Data Ltd
How to use the Mail Form Program
Home Company information Request information Prices Clients Site map Contact us


The mail form program is used to collect data from an HTML FORM and e-mail it to a user.


The Data Collection Page

Minimum HTML

On the data collection page the following is the minimum HTML required:

<FORM Action="/cgi-bin/mailfm.cgi" Method=POST> See notes 1 and 2


  1. The Method value must always be POST. If it is not POST, the data will NOT be emailed to the recipient.
  2. For clients who are using web forwarding - that is sites that have their web pages on another server such as an ISP - the Action value should be set to Action="http://www4ward.hcidata.com/cgi-bin/mailfm.cgi". To prevent usage of this facility by non-clients of HCI Data Ltd, this script can only be run from known URLs. So clients of HCI Data Ltd must notify us of the URLs of pages that use this facility.
  3. This value must be set to the e-mail address of the person who will receive the e-mail with the data collected. For example:
    <INPUT TYPE="HIDDEN" NAME="TO" VALUE="joebloggs@hcidata.co.uk">
    We recommend that the email address is not put in a clear form but is obfuscated. See how to obfuscate an email address for more details. The TO field must have the same domain as the web page that uses this service.
  4. This value can be set to an absolute or relative URL of the page that will be displayed to the user to indicate that the data collection information has been sent. An example of an absolute URL is:
    <INPUT TYPE="HIDDEN" NAME="THANKYOU" VALUE="http://www.mydomain.co.uk/thankyou.html">
    An example of a relative URL is:
    <INPUT TYPE="HIDDEN" NAME="THANKYOU" VALUE="/thankyou.html">

Additional HTML

The FORM so far is not very useful. All it sends to you is a blank email. This is because no data collection fields have been set up.

To set up data collection fields, include HTML between the <FORM> and </FORM> tags similar to:

<input type="text" name="010 - name - " size=40 maxlength=60 >

Note that the NAME value starts with a number. When the email with the data is sent, it is sorted based on the NAME values. So, if order is important to you then prefix each NAME value with a number.

Email Values

There are some values that are used for the email headers. It is strongly suggested that these are all set as HIDDEN fields within the FORM. The most important one to set is the Subject as:

<INPUT TYPE="HIDDEN" NAME="SUBJECT" VALUE="The Subject of the email">

An Example

The following is a working example:

<FORM Action="/cgi-bin/mailfm.cgi" Method=POST>
<INPUT TYPE="HIDDEN" NAME="TO" VALUE="clients.test@hcidata.com">
<INPUT TYPE="HIDDEN" NAME="SUBJECT" VALUE="client test of mailfm.cgi">
<INPUT TYPE="HIDDEN" NAME="THANKYOU" VALUE="http://www.hcidata.com/thankyou.htm">
<!-- The numbers (01 -etcetera) will sort the information -->
Contact Name :
<input type="text" name="010 - name - " size=40 maxlength=60>
Contact E-mail :
<input type="text" name="030 - MAILTO" size=30 maxlength=50>
Company Name :
<input type="text" name="110 - company name - " size=40 maxlength=60>
Website :
<input type="text" name="120 - website - " size=40 maxlength=60 VALUE="http://www">
Additional Infromation :
<TEXTAREA NAME="900 - message" ROWS="3" COLS="40"> </TEXTAREA>

And this is what it produces.......

Contact Name :
Contact E-mail :
Company Name :
Website :
Additional Infromation :

Valid XHTML 1.0 Transitional
Last Updated: 18-Jun-2014
HCI Data Ltd.
HCI Data Ltd is a member of Nominet UK - the  UK Internet  Names Organisation HCI Data Ltd is a member of the Federation of Small Businesses