Emailform for Windows NT

Emailform is a CGI program designed to allow people to create simple forms without having to create custom CGI scripts or programs to process them. Instead, it takes the input from the form, and forwards it to an e-mail address in a human- and machine-readable form. It is also handy for testing forms for proper input before writing a custom CGI script to handle it.

How does it differ from using "mailto" as the action on the form? Well, "mailto" sends the form input in a special encoded string, which encodes special characters such as spaces, and has all the form input items as one giant string. This has to be decoded by a program to be useful. emailform decodes that information and sends it in a much nicer, easier-to-read format, so humans can see exactly what the input was, and still be able to feed it to a program by hand. Since the decoding is already done, writing a script or program to take the input is much easier - you don't need to understand URL encoding at all.

NOTE: emailform will only send to "uml.edu" addresses.

How does it work?

Simple. Create a standard HTML form as you normally would. The "METHOD" for the form must be "POST" (emailform does not handle the "GET" method at this time). Then, include one additional input, of type HIDDEN, which will contain the e-mail address to send the form input to. Call this input "mailto". Here is an sample line:

<INPUT TYPE=HIDDEN NAME="mailto" VALUE="Joe_User@uml.edu">

You can optionally include another HIDDEN input, called "mailsubject", which would be set to the string you want the subject of the mail to have, in case you are using it for several different forms. The default subject line is ""E-Mail Form Submission". Here is an example using a different subject:

<INPUT TYPE=HIDDEN NAME="mailsubject" VALUE="Catalog Request">

After you have created your form, set the form ACTION to run the emailform program. Assuming it is installed on the same server as your page, this would usually be "/cgi-bin/emailform". emailform is available on www.uml.edu and www.cs.uml.edu, and should only be used by pages on those servers.

Now let's look at a full example of a form, and then we can take a look at what you would receive via e-mail. This form accepts a name and address:

<FORM METHOD=POST ACTION="/cgi-bin/emailform">

<INPUT TYPE=HIDDEN NAME="mailto" VALUE="Joe_User@uml.edu">
<INPUT TYPE=HIDDEN NAME="mailsubject" VALUE="Catalog Request">

Name: <INPUT TYPE=TEXT VALUE="" SIZE=50 NAME="name"><P>
Address: <INPUT TYPE=TEXT VALUE="" SIZE=50 NAME="address"><P>
City: <INPUT TYPE=TEXT VALUE="" SIZE=50 NAME="city"><P>
State: <INPUT TYPE=TEXT VALUE="" SIZE=50 NAME="state"><P>
Zip Code: <INPUT TYPE=TEXT VALUE="" SIZE=10 NAME="zip"<P>
<INPUT TYPE=SUBMIT VALUE="Submit Information"><P>
</FORM>

If a user typed in "Joe User", "1 University Ave.", "Lowell", "MA", and "01854", the person at "user@foo.bar.com" would receive e-mail with the subject "Catalog Request", and the body of the message would look like this:

Your form has submitted the following information (shown as label = value):

START-OF-INPUT
name = Joe User
address = 1 University Ave.
city = Lowell
state = MA
zip = 01854
END-OF-INPUT

emailform version 2.0

As you can see, the output is very readable. The "START-OF-INPUT" and "END-OF-INPUT" lines make it easier for a program to take this message and read only the relevant input, but a person can read the input directly and perform some task.

emailform 2.X has added additional output forms. Simply create another HIDDEN value called "outputform", and the following table explains the values and their effects:

Value Effect
standard (default if not specified) name1 = value1
name2 = value2
...

Standard 1.0 output form as above

comma value1,value2, value3,...

Ideal for database imports

list value1
value2
...

Like "standard", but input names are not given