Colorado
Web Hosting FormMail Tutorial
Table
of Contents
Introduction
Creating
an E-mail form on your Web Site is easy, yet flexible with FormMail.
We have done all the programming for you already so that you do
not have to know anything about writing CGI scripts to create your
own E-mail submission forms for your Web Site.
You
do NOT have to modify a single piece of cgi-bin code--the same cgi-bin
program will work with anyone's form! Even if you do know how to
write E-mail submit forms, you will find this beneficial as an easy-to-use,
productive, and flexible way to create most of your mailto forms.
All
kinds of different forms with input fields, option lists, checkboxes,
radio buttons, text areas, and selection lists may be used. Formatting
of the email response is smart. You may choose to specify required
input fields to be submitted before anything is emailed to the recipient's).
Subject and Reply-to email headers are correctly set for most email
readers with properly created forms. The response you desire to
give after submission (and incorrect submission if required fields
are specified and not submitted) may be specified in the form as
a url that you may create just like you create any other html file.
Getting
Started
You
must request FormMail be added to your domain (at no cost) before
it will work. Click here to
request it.
In
order to use our script you must specify the correct method and
action for the form. The METHOD should be set to post indicating
that the form will be submitted separately from the URL so that
large submissions will not lose any data. The ACTION should be set
to /cgi-bin/FormMail.pl. Please remember that this is case
sensitive.
<FORM
METHOD="POST"
ACTION="http://www.yourdomain.com/cgi-bin/FormMail.pl">
...
</FORM>
Required
Configuration Options
Specify
the email recipient of the form
You
may specify who is to receive the email form by using a reserved
input tag of FormMail software. This is required to have your form
work correctly with the script.
An
input tag should be used. You should set TYPE to hidden and have
NAME set to recipient. Case is important with the NAME value. VALUE
must be set to the email address of who you would like to receive
submissions from the form.
<INPUT
TYPE="HIDDEN" NAME="recipient"
VALUE="info@yourdomain.com">
You
may specify multiple recipients by delimiting them with a comma.
<INPUT
TYPE="HIDDEN" NAME="recipient"
VALUE="info@yourdomain.com,sales@yourdomain.com">
Specify
the response URL for correct submissions
After
a form is submitted, FormMail will display a response page to the
user that you must create and specify. This allows you the freedom
to give any response to the user of the form you would like with
the page design and links you desire.
You
do this by creating an html file that you may name anything you
desire and that may contain any response message that you may wish
to give. An example response file is as follows:
<HTML>
<HEAD><TITLE>Response</TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF">
<IMG SRC="/images/sample_logo.gif">
<H2>Thank You!</H2>
<P>
Our staff will promptly process your request
for more information.
<A HREF="/">Return to our Home Page</A>
</BODY>
</HTML>
To
create and save this file, simply drag your mouse over the text
above and select Copy from your Edit Menu, then open a Text Editor
(like Notepad for Windows) and select Paste from Text Editor's Edit
Menu. Save and then upload this file to your Web Site's root directory
and save it with an HTML file name you would like such as "response.html."
Next,
you must specify to FormMail what response file to use. You must
reference this file using its full URL. If your domain happens to
be "www.your_domain.com" and the response file was saved
in the root directory of the website as "response.html",
the full URL would be: http://www.your_domain.com/response.html
An
INPUT tag should be used. You should set TYPE to HIDDEN and have
NAME set to response. ("response" must be in lower case.
Case is important with the NAME value) VALUE must be set to the
full URL of the response page as described:
<INPUT
TYPE="HIDDEN" NAME="redirect"
VALUE="http://www.yourdomain.com/response.html">
Optional
Configuration Parameters
Setting the Reply-to E-mail header
The
process of including a reply-to header in an e-mail message from
the web server is not automatic since the web server has no way
of knowing everyone's e-mail address. An e-mail address to reply-to
must be submitted by the person submitting the form.
In
order to set the reply-to email header to the person submitting
the form, an input field must be included that requests the user
to input their email address. The input field must have the name
email. An example is given:
<B>Enter
Your Email Address:</B>
<INPUT NAME="email">
In
addition, you can have this header to include in parenthesis the
name of the person/people that this email message is from. This
input field must have the name realname. An example is given:
<B>Enter
Your Name:</B>
<INPUT NAME="realname">
You
may use this in conjunction of setting required fields to make sure
a person submitting a form has submitted an email address to reply
to. An example is given:
<INPUT
TYPE="HIDDEN" NAME="required"
VALUE="email,realname">
<INPUT TYPE="HIDDEN" NAME="missing_fields_redirect"
VALUE="http://www.yourdomain.com/required.html">
<B>Enter Your Email Address:</B>
<INPUT NAME="Email">
<B>Enter Your Name:</B>
<INPUT NAME="Name">
Specify the subject of the email message
You
may specify the subject of the email that is to be sent by using
a reserved input tag of FormMail.
An
input tag should be used. You should set TYPE to hidden and have
NAME set to subject. Case is important with the NAME value. VALUE
must be set to whatever you would like the subject to be of the
email sent to the recipient(s). An example is provided:
<INPUT
TYPE="HIDDEN" NAME="subject"
VALUE="Reply from your website!">
Specify required submission fields
You
may specify what input fields are required to be completed before
any email is sent.
An
input tag should be used. You should set TYPE to hidden and have
NAME set to missing_fields_redirect. Case is important. Next, specify
the required field names by setting VALUE equal to the fields that
are required. Separate each field with a comma and include no spaces
unless the field name contains a space. Fields are the same as the
string provided in the NAME of an INPUT tag.
<INPUT
TYPE="HIDDEN" NAME="missing_fields_redirect"
VALUE="realame,email">
You
must specify the response URL to give the user for unsuccessful
submission because of missing required fields. You create this file
similar to the way you created the response file for successful
submissions.
An
input tag should be used. You should set TYPE to hidden and have
NAME set to missing_fields_redirect. Case is important with the
NAME value. VALUE must be set to the full URL of the response page
as described.
<INPUT
TYPE="HIDDEN" NAME="missing_fields_redirect"
VALUE="http://www.yourdomain.com/required.html">
Notes
All
INPUT tags may be used of any TYPE, including CHECKBOXES and RADIO
BUTTONS. Make sure that you give the same name to each radio button
that you want the user to choose from and give a unique value to
each one that you want sent to you that will identify the radio
button that was selected. TEXTAREA, SELECT, and OPTION tags may
also be used.
Whatever
is specified as the NAME will be printed in the email form followed
by a colon and a tab. The VALUE assigned to the NAME will follow
the NAME. In the cases where VALUE is assigned in the form, this
will be printed if it is selected. If the VALUE is to be specified
by the user, this VALUE will be printed if a value is given by the
user. Multiple fields with the same names are also properly handled
and all fields will be printed that have values.
Be
sure to include the <INPUT TYPE=SUBMIT> tag.
If
you have any questions about this software, bug reports, or suggestions,
please send them to cgi@coloradowebhosting.com. |