|
GUIDE - formmail.pl

formmail.pl (version
1.5)
Homepage: http://www.worldwidemart.com/scripts/
Modifications Required: none
Optional Modifications: None recommended.
formmail.pl is a form delivery script with a wide
variety of options. It is much more flexible than the form.cgi script, but less so
than the cgiemail
script. It accepts form submissions via either GET
or POST methods, and allows e-mail to be sent to
addresses outside the your domain. For sample usage,
please see its How-To Guide.
The following fields can be defined for formmail.pl;
only the recipient field is required:
- recipient (required)
- This field specifies the destination e-mail address
for the form contents. Example:
<INPUT TYPE="hidden"
NAME="recipient" VALUE="address@domain.com">
- subject
- This field specifies the Subject line of the outgoing
e-mail. If not given, the default Subject is
"WWW Form Submission". Example:
<INPUT TYPE="hidden"
NAME="subject" VALUE="Some
Subject Line">
You can also allow the user to specify the Subject
field:
<INPUT TYPE="text"
NAME="subject">
- email
- This field specifies the return e-mail address of the
user submitting the form. If supplied, this should be
a field filled in by the user. The e-mail will be
generated so that your mailer's reply function should
go to this address; if not supplied, the default is nobody@pair.com.
Example:
<INPUT TYPE="text"
NAME="email">
- realname
- This field specifies the real name of the user
submitting the form. If supplied, this should be a
field filled in by the user. The e-mail will be
generated with this name in the headers. Example:
<INPUT TYPE="text"
NAME="realname">
- redirect
- This field specifies the URL to which the user should
be automatically redirected after successful delivery
of the form. If this is not specified, a default
response will be generated by the script. Example:
<INPUT TYPE="hidden"
NAME="redirect" VALUE="http://domain.com/whatever.html">
- required
- This field allows you to specify that certain fields
in the form are "required"; that is, that
they may not be empty when the form is submitted. If
any of the specified fields are empty, the user will
receive a warning, and the form will not be
submitted. Example:
<INPUT TYPE="hidden"
NAME="required" VALUE="email,subject">
- env_report
- This field specifies a list of environment variables
that should be submitted along with the form
contents. This is useful for recording, for example,
the IP address of the user submitting the form.
Useful environment variables to record include:
- REMOTE_ADDR - IP address of the
user's host
- HTTP_USER_AGENT - name and version
of the user's browser
Note: Case is important for environment variables.
You can see the typical environment variables using
the test.cgi
script.
Example:
<INPUT TYPE="hidden"
NAME="env_report" VALUE="REMOTE_HOST,HTTP_USER_AGENT">
- sort
- This field specifies how the fields submitted from
the form should be sorted in the outgoing e-mail
message. By default, the fields are not in any
particular sort order (results are dependent on the
user's browser). You may specify
"alphabetic" for straight alphabetic
sorting (same as form.cgi, described above),
or you may specify the exact order with
"order:". Examples:
<INPUT TYPE="hidden"
NAME="sort" VALUE="alphabetic">
<INPUT TYPE="hidden"
NAME="sort" VALUE="order:name,email,phone">
- print_config
- This field specifies that the formmail.pl
control fields, normally removed from the body of the
outgoing message, be included for completeness.
Example:
<INPUT TYPE="hidden"
NAME="print_config" VALUE="email,subject">
- title
- This field specifies the title for the default
response page that is generated by the script in
absence of a redirect field. The default is
"Thank You". Example:
<INPUT TYPE="hidden"
NAME="title" VALUE="Form
Results">
- return_link_url
- This field specifies a URL that will appear on the
default response page that is generated by the script
in absence of a redirect field. This URL can
be used to allow users to return to, for example,
your home page. Example:
<INPUT TYPE="hidden"
NAME="return_link_url" VALUE="http://domain.com/">
- return_link_title
- This field specifies the text that will be used
inside the link generated when return_link_url
is specified. Example:
<INPUT TYPE="hidden"
NAME="return_link_title" VALUE="Return
to Home Page">
- background
- This field specifies the URL of a background image
that will be used on the default response page that
is generated by the script in absence of a redirect
field. Example:
<INPUT TYPE="hidden"
NAME="background" VALUE="http://domain.com/img/bkgr.gif">
- bgcolor
- This field specifies the background color that will
be used on the default response page that is
generated by the script in absence of a redirect
field. Example (pure white):
<INPUT TYPE="hidden"
NAME="bgcolor" VALUE="#FFFFFF">
- text_color
- This field specifies the text color that will be used
on the default response page that is generated by the
script in absence of a redirect field.
Example (pure black):
<INPUT TYPE="hidden"
NAME="text_color" VALUE="#000000">
- link_color
- This field specifies the unvisited link color that
will be used on the default response page that is
generated by the script in absence of a redirect
field. Example (pure red):
<INPUT TYPE="hidden"
NAME="link_color" VALUE="#FF0000">
- vlink_color
- This field specifies the visited link color that will
be used on the default response page that is
generated by the script in absence of a redirect
field. Example (pure blue):
<INPUT TYPE="hidden"
NAME="vlink_color" VALUE="#0000FF">
- alink_color
- This field specifies the active link color that will
be used on the default response page that is
generated by the script in absence of a redirect
field. Example (pure green):
<INPUT TYPE="hidden"
NAME="alink_color" VALUE="#00FF00">
Note that this script can also be referenced as FormMail.pl.
|