CGIemail

The instruction contained herein can be used to modify an existing HTML form to work with a preinstalled script called "cgiemail". The cgiemail script resides in the server's cgi-bin directory and does NOT have to be installed within your own account. Merely reference cgiemail as illustrated in the following HTML form action:

<form method="post" action="/cgi-bin/cgiemail/form.txt">

This code calls the preinstalled script cgiemail which is in the server's cgi-bin directory once the web page visitor clicks the "submit" button. The script cgiemail in turn calls a text file (or template) called form.txt. The template defines the format by which the submitted form content is to be sent via e-mail. To view the working form.txt template for this web site click here.

You can create the template in a basic text editor beginning with the following three lines:

From: [name]
To: username@yourdomain.com
Subject: Information Submittal

Substitute the desired recipient e-mail address and subject above. Next, you will need to add ALL field names within the HTML form to the template in a form similar to the following:

From: [name]
To: username@yourdomain.com
Subject: Information Request

Address: [address]
Telephone: [telephone]

As long as each form field name is contained within brackets ("[ ]") within the template and HTML form and they match exactly, the e-mail should be sent successfully and contain all submitted data. We suggest you use all lowercase field names within your HTML form and template. Be sure to upload the template to your public_html directory in ASCII transfer mode.

There are certain bits of information that you may want from the visitor such as their e-mail address. You can set up "required" items by adding this to your template:

E-mail: [required-email]

If you want a specific web page to load when the e-mail is successfully sent, such as a thank you note, add the follow code to your HTML form:

<INPUT TYPE="hidden" NAME="success" VALUE="http://www.yourdomain.com/thanks.html">

Substitute the URL of the file you wish to load after form data is submitted. The field name in this case MUST be "success", but does not need to be added to the template.

If you are implementing a secure form in conjunction with cgiemail, you will need to reference the script in the form ACTION as well as the "success" URL securely. Please note that the "secure" environment refers to information transmitted from web browser to web server. The resulting e-mail message that gets sent from the our computers is not encrypted and therefore not secure.

Now that your template has been configured it will be necessary to build your form in HTML code. Please refer to the Univox FAQ "Forms" for information on this. If you would like to see an example of a working CGIemail form you can click here.

If you would like further information on cgiemail please visit the site of its developer.

Return to table of contents

© 2007 Univox Internet, Inc.