Back to Help

CgiEmail.cgi helpful information:

For full documentation and configuration options, visit the cgiemail user guide at http://web.mit.edu/wwwdev/cgiemail/user.html

We will attempt only a simplistic study of cgiemail in our help file.

Cgiemail is a program written in the C language that takes the contents of fill-in boxes on a form and emails them to a specified destination. In addition to the form specification in the .html file, a mail specification in a .txt file is required to format the resulting email message.

We provide cgiemail in the cgi-bin directory of each machine. Thus, it would be called with a URL such as /cgi-bin/cgiemail/mail.txt.

Here's a simple example -

Create a text file called "example" in the main web directory.

This is the contents of the file:

To: jon@site-city.com

Subject: example

------

This is a test message.
This is a test message.
name: [name]
phone: [phone]

That is the file that will be sent to jon@site-city.com.

Now, cgiemail will automatically replace [name], [phone], anything in the brackets with the corresponding user supplied info from the web form. Also, you MUST have the To: and the Subject: line followed by the blank line. Those three lines MUST be on the FIRST THREE lines. You cannot change the From: address.

Here is a part of the web form page called "example.html"

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

<input type=text name="name">Your name?

<input type=text name="phone">your number?

etc...

If you want to have your own customized "success" page, place the following line in your form page:

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

It will then redirect to somepage.html.

Back to Help