CGIemail

CGIemail is a script that allows you to send the contents of a form to an email address. While it can make the results look a little bit nicer than Formmail, it is considerably more difficult to set up than Formmail.

You can learn more about CGIemail by visiting their user guide. If you have any questions or comments about CGIemail, please consult their guide.

To begin you will need to create a template. A template might look like:

From: [email]
To: email@yourdomain.com 
Subject: questions three

What is your name?              [yourname]
What is your favourite color?  [color]

Now upload this template to your site. You should upload it into your public_html directory. While you can name the template anything, you will need to note the name of the template. For this example, I named my template template.txt. There are a couple of things to note. First, notice the double space after the Subject line. This is used to symbolize the end of the email headers, this is required. Second, note the words inside the brackets ([]'s). These will be used later when you construct the form.

NOTE: Do not use space when you are naming your form options, denoted by the words inside the brackets ([]'s).

Now you will need to create a form. To go along with the template I created earlier, my form looks like:

<FORM NAME=Inquiry ACTION=/cgi-bin/cgiemail/template.txt METHOD=POST>
Your Email Address: <INPUT TYPE=textbox NAME=email><br>
Your Name: <INPUT TYPE=textbox NAME=yourname><br>
Favorite Colour: <INPUT TYPE=textbox NAME=colour><br>
<INPUT TYPE=Submit>
</FORM>

There are a couple things that need to be noted here as well. First note the NAME parameters. Each INPUT TYPE will have a NAME parameter. This will correspond directly to the words you entered in the templates in the brackets. For example, the line:
Your Name: <INPUT TYPE=textbox NAME=yourname><br>
will refer to:
What is your name?              [yourname]
in the template.

Instead of the system emailing you:
What is your name?              [yourname]
it will send you:
What is your name?              The user's name
Also, note the first tag in the FORM:
<FORM NAME=Inquiry ACTION=/cgi-bin/cgiemail/template.txt METHOD=POST>
You can Name the form anything, but the ACTION parameter must be set as above. With the exception that template.txt becomes whatever you named your template at the start. The system will then send email to the To: portion of the template, and the email will look just as it does in the template.