UAF's collection of CGIs contain a CGI program named email, which can be used for handling forms.
The email CGI accepts inputs from a form and emails the results to an address specified in the form. Upon successful completion of the task, it returns to the user a screen indicating the successful submission of the form and (optionally) a link to follow for additional information.
To invoke the email CGI, the ACTION= attribute in
your <FORM> tag should read ACTION="http://cgis.uaf.edu/cgi-bin/email".
The METHOD should be POST (a METHOD of
GET will invoke an error message).
The program will decode INPUTs into Name = Value
pairs in an email message and mail them to an indicated address. It recognizes
seven INPUTs for its own processing purposes (all others will simply
be decoded and reported in the email message). The six INPUTs the
program uses are named mailto,
name, mail, formname, nexturl,
nextdesc, redirurl. The mailto INPUT is required,
and indicates the address to which the form results will be emailed. The name
and mail INPUTs are also required and will produce an
error message to the user if not present. These two indicate the name and email
address of the user submitting the form, but may be stuffed with dummy values
(like N/A) and placed in
TYPE="hidden" fields if an anonymous form is preferred.
The formname
INPUT will be placed into the beginning of the email message to
indicate which form this message represents (a department may have multiple
forms). I recommend that this INPUT be placed in a TYPE="hidden"
field. You have 14 characters in which to identify the form. The nexturl
and nextdesc
INPUTs are for creating the anchor (link) on the results page
returned to the user. The nexturl INPUT should contain
the URL for your information or NEXT page, and the nextdesc should
contain the text describing the link. I recommend that both of these belong in
TYPE="hidden" fields. redirurl INPUT is a
user defined results page. Please note that all of these
INPUTs have a maximum length of 64 characters (except formname,
which has 14 and mailto, which has 128).
On Monday, November 23, 1998 many new features were added. All the old functions work the same. The new functions are:
R- demarks a required field. (note - you must use a
capital R). Previous versions of the CGI required name and mail fields. If
you have a legacy form you need not change it, the CGI will recognize those
two fields as R-name and R-mail.
INPUT called userhide - if any value is
assigned to userhide
this feature is turned OFF. userhide can be a hidden input or you can make
it a checkbox on the form. Any field name that begins with the two characters
H- will not be reported to the user. (note - you must use a capital H).
For an example of how to use the updated email CGI, you may refer to
http://www.uaf.edu/webauthors/testform/emailtest.html.
Be sure to examine the source html file. Please note that the
mailto INPUT in this example form has been left for
you to fill in so that you may mail your tests to yourself. This practice is
STRONGLY discouraged in any forms you create. The most flexibility you
should build into the mailto field for your forms is a SELECT
field, CHECKBOXes, or
RADIO buttons with limited specific addresses. This CGI should
not be used for a general mailer.
The University of Alaska Fairbanks is an AffirmativeAction/Equal Opportunity Employer and Educational Institution.
Office of Information Technology - PO Box 757700 - Fairbanks, Ak 99775-7700
ph: 907-474-6564 / fax: 907-474-5910
Last modified 08/08/2006
by fxdjl@uaf.edu