Formmail
allows you to create form-to-e-mail forms without CGI scripting.
To
use Formmail, create a form with any web page creation software.
The
form action line should be:
<form
method="POST" action="/cgi-sys/formmail.pl">
Notice
that the path is /cgi-sys. This is the path to our universal
CGI BIN, that holds the 'formmail.pl' script.
The
'formmail.pl' script will do all the programming work
for you. The behavior of formmail is determined by using hidden
fields in your form.
**
The "Recipient" field is the only form field that
you must have in your form for Formmail to work correctly.
Field:
Recipient
This
form field allows you to specify to whom you wish your form
results to be mailed. Most likely, you will want to configure
this option as a hidden field with a value equal to that of
your e-mail address.
<input
type=hidden name="recipient" value="username@your_domain.com">
Optional
Form Fields:
Field:
Subject
The
subject field will allow you to specify the subject that you
wish to appear in the e-mail that is sent to you after this
form has been filled out. If you do not have this option turned
on, then the script will default to a message subject: WWW Form
Submission
If
you wish to choose what the subject is:
<input type=hidden name="subject" value="Your
Subject">
To
allow the user to choose a subject:
<input type=text name="subject">
Field:
E-mail
This
form field will allow the user to specify their return e-mail
address. If you want to respond via e-mail to your user, you
should include this form field and possibly even as a "required"
field to insure that you receive the information. This will
be put into the "From" field of the message you receive.
<input
type=text name="email">
Field:
Realname
The
realname form field will allow the user to input their real
name. This field is useful for identification purposes and will
also be put into the "From" line of your message header.
<input
type=text name="realname">
Field:
Sort
This
field allows you to choose the order in which your data will
appear in the e-mail that FormMail generates. You may choose
to have the field sorted alphabetically or in any order you
choose. By leaving this field out, the order will simply default
to the order in which browsers send the information to the script.
This is not always the same order they appeared on your form.
When sorting by a set order of fields, you should include the
phrase "order:" as the first part of your value for
the sort field. You then follow with the field names you want
to be listed in your e-mail message, separated by commas.
To
sort alphabetically:
<input type=hidden name="sort" value="alphabetic">
To
sort in the order of your choice:
<input type=hidden name="sort" value="order:name1,name2,etc...">
Field:
Redirect
If
you wish to redirect the user to a different URL, rather than
having them see the default response to your form, you can use
this hidden variable to send them to another HTML page of your
choice.
To
choose the URL the user will be directed:
<input type=hidden name="redirect" value="http://your_domain.com/filename.html">
To
allow the user to specify the URL he/she wishes to travel once
the form has been submitted:
<input type=text name="redirect">
Field:
Required
You
can now require certain fields in your form be completed before
the form can be submitted. Simply place all field names that
you want to be mandatory in this field. If the required fields
are not filled in, the user will be notified of what needs completed
and directed to use a hyperlink back to the form.
<input
type=hidden name="required" value="email,phone">
Field:
env_report
This
field allows you to have Environment variables included in the
e-mail message you receive after a user has submitted your form.
This is a useful tool if you need information as to what browser
they were using, what domain they were coming from or any other
attribute associated with environment variables. The following
is a short list of valid environment variables that you may
find useful:
REMOTE_HOST:
Sends the remote hostname of the user making the request.
REMOTE_ADDR:
Sends the IP address of the remote host making the request.
HTTP_USER_AGENT:
Provides the browser the client is using to send the request.
General format: software, version library, version.
If
you want information about the remote host and browser sending
the request, you need to include the following in your form:
<input type=hidden name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT">
Field:
title
This
form field allows you to specify the title and header that will
appear on the resulting page if you do not specify a redirect
URL.
If
you want to choose the title of "Feedback Form Results":
<input type=hidden name="title" value="Feedback
Form Results">
Field:
return_link_url
This
field allows you to specify a URL that will be used as a "return_link_title",
on the following report page. This field will not be used if
you have the redirect field set. It is useful if you allow the
user to receive the report on the following page, but want to
offer a way to get back to your home page.
<input
type=hidden name="return_link_url" value="http://your_domain.com/filename.html">
Field:
return_link_title
This
is the title that will be used to link the user back to the
page you specify with return_link_url. The two fields will be
shown on the resulting form page as:
<ul>
<li><a href="return_link_url">return_link_title</a>
</ul>
<input
type=hidden name="return_link_title" value="Back
to Main Page">
Field:
background
This
form field allows you to specify a background .gif image that
will appear if you do not have the redirect field set. This
image will appear as the background .gif to the form results
page.
<input
type=hidden name="background" value="http://your_domain.com/image.gif">
Field:
bgcolor
This
form field allows you to specify a background color for the
form results page in basically the same way you specify a background
image. This field should not be set if the "redirect"
field is set.
For
a background color of white:
<input
type=hidden name="bgcolor" value="#FFFFFF">
Field:
text_color
This
field works in the same way as the "bgcolor" field,
but is used to change the color of your text.
For
a text color of black:
<input
type=hidden name="text_color" value="#000000">
Field:
link_color
This
field changes the color of the hyperlinks text on the resulting
page. It works in the same way as "text_color". This
should not be defined if the "redirect" field is.
For
a link color of red:
<input type=hidden name="link_color" value="#FF0000">
Field:
vlink_color
Changes
the color of visited hyperlinks on the resulting page. It works
exactly the same as "link_color", and should not be
set if the"redirect" field is.
For
a visited link color of blue:
<input type=hidden name="vlink_color" value="#0000FF">
Field:
alink_color
Changes
the color of active links on the resulting page. Works exactly
the same as the "link_color" field and should not
be set if "redirect" field is.
For
a visited link color of blue:
<input type=hidden name="alink_color" value="#0000FF">
Any
other form fields that appear in your form will be mailed back
to you and displayed on the resulting page if you do not have
the redirect field set.