For best performance and viewing, please update your browser to Netscape 7.0, or IE 5.0 or greater.
Northern New England's Largest Internet Service Provider
GWI: Great Works Internet Technical Support
Residential services  Business services  About us  Technical support  About your account
Using the Internet Dial Up Support Email Support Web Page Help Broadband Support Phone Support Internet Security Contact Support
Text size smaller normal larger largest
CGIEmail

GWI has installed cgiemail support on both our personal and commercial web servers. It's use is very similar on both. To use CGIEmail you must create an HTML form and a Template Text file. See below for examples of a simple form and the text file to go with it.


Example-Form HTML

The following is the HTML code that is used to make the Example-Form at the bottom of the page. Most HTML guides will have more tags that can be used with your form. The most important part of this form is the ACTION= attribute of the <FORM> tag. In this example, it is set to "/cgi-bin/cgiemail/example-form.txt".

This is not the path to where the "example-form.txt" file is located. The path for that file is actually just "/example-form.txt". The "/cgi-bin/cgiemail" part is telling our server that you want to send the form information through the cgiemail program. If you have this information wrong, cgiemail will tell you that it cannot find the file when you submit the form.

<HTML>

<HEAD>

<TITLE>Example-Form</TITLE>

</HEAD>

<BODY>

<P>This is an Example-Form. Please enter your email address in the "To:" field, some text in the "Message:" field, and then press the submit button.</P>

<FORM METHOD=POST ACTION="/cgi-bin/cgiemail/example-form.txt">

<P>Please enter your full email address (username@gwi.net):</P>

<P><INPUT NAME="required-to" SIZE="50"></P>

<P>Please enter some text below.</P>

<P><TEXTAREA NAME="example-form-text" ROWS=8 COLS=60></TEXTAREA></P>

<P><INPUT TYPE=Submit VALUE="Send Email"><INPUT Type=Reset VALUE="Reset Form"></P>

<P>Please note, this is a working form, try it by entering your email address and some text, then pressing "Submit." Then check your email.</P>

</FORM>

</BODY>

</HTML>


Example-Form Text File

You also need to create a text file that will format the information gathered by the form. The information in brackets is what is filled in on the form. Please note that the names in the brackets match the NAME attribute setup in the form. This file can be anywhere in your website, as long as the form is setup correctly to access it.

To: [required-to]
From: "GWI Support" <support@gwi.net>
Subject: Example-Form E-mail Message

This email was generated using cgiemail and the form "Example Form" on www.gwi.net. The person filling out the form wished to say:

[example-form-text]


Example-Form (This Really Works!)

This is an Example-Form. Please enter your email address in the "To:" field, some text in the "Message:" field, and then press the submit button.

Please enter your full email address (username@gwi.net):

Please enter some text below.

Please note, this is a working form, try it by entering your email address and some text, then pressing "Send Email." Then check your email.


More Information Below

If you tried copying the above and it did not work, here are some things to look for:

1. Is the HTML document calling the cgiemail correctly?

On our Commercial Server it should look like:

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

On our Personal Server it should look like:

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

(*Note: The name of the text document must match with what is being called from the HTML document, including capitalizations. Spaces not recommended in file names.)

2. Is the text template in the www folder (for Personal Server) or the root folder (for Commercial Server)? Is it setup correctly? The text template will look the same for both Servers.

Here is a basic sample we'll call template.txt.

From: [required-emailaddr]
To: John Doe <jdoe@gwi.net> (must use < > around email address)
Subject: E-mail Response Form

Information obtained by customers
Name: [firstname] [lastname] (values in HTML doc must match bracketed items)
Email Address: [required-emailaddr]
City: [city] St: [state]
Country: [country]
Comments: [comments]

Here is a basic sample of the HTML doc to go with template.txt.

<html>
<body>
<form method="post" action="/cgi-bin/cgiemail/template.txt">
<br>
<h5><font color=#0000ff>*</font> = (required field)</h5>
<br>
<input type="text" name="firstname" size="30" maxlength="30">First Name
<br>
<input type="text" name="lastname" size="30" maxlength="30">Last Name
<br>
<input type="text" name="required-emailaddr" size="30" maxlength="30">Email Address <font color=#0000ff>*</font>
<br>
<input type="text" name="city" size="30" maxlength="30">City
<br>
<input type="text" name="state" size="30" maxlength="30">St
<br>
<input type="text" name="country" size="30" maxlength="30">Country
<br>
Comments:
<br>
<textarea name="comments" rows="5" columns="40"></textarea>
<br>
<input type="hidden" name="success" value="http://www.gwi.net/">
<input type="reset" value="Reset"> <input type="submit" value="Submit">
</form>
</body>
</html>

You can copy and paste the template and HTML doc into your own files called form.html and template.txt and upload them to your website to test. If you are uploading to our Personal Server you must edit two things. 1) In the template, change jdoe@gwi.net to your own email address. 2) Add ~username(where username is YOUR username) in the form line as specified in #1. for Personal Server. If you are uploading to our Commercial Server the only thing you need to change is the email address from jdoe@gwi.net to your own. You can make these fields required by adding required- like we did for the email address (e.g. required-emailaddr).

3. Check Permissions

Check permissions on the cgi-bin.

It should be 755 or drwxr-xr-x.

Check permissions on cgiemail.

It should be 755 or -rwxr-xr-x.

(*Note: cgiemail must be installed in your cgi-bin on our Commercial Server. If you need cgiemail installed, please call Technical Support at 800-229-2096 or email support@gwi.net. Our Personal Server does not require the cgi-bin or cgiemail to be installed.)

These are the three major things to look for when cgiemail is not working. If you need more help, check out: http://web.mit.edu/wwwdev/cgiemail/.