To make use of it, you need to write an HTML form that
refers to the FormMail script. Here's an example which will send mail
to the address
'feedback@your.domain' when someone submits the form:
<form method="POST" action="http://scripts.zetnet.co.uk/cgi-bin/formmail.pl">
<input type="hidden" name="recipient" value="feedback@your.domain">
<input type="text" name="feedback"><br>
Please enter your comments<br>
<input type="submit">
</form>
Please note that the above script used to reside on
puddle.zetnet.co.uk. If you used to use the script on Puddle and are now
changing to scripts.zetnet.co.uk, you will need to re-register your e-mail
address with webweaver. However, we have no intention of removing support
for the older script; so you may continue to use it without change.
See how the hidden 'recipient' input in the example
above told formmail who to send the mail to ? This is how almost all of
formmail's configuration works. Here's the full list of things you can
set with hidden form inputs:
The email address to which the form submission
should be sent. If you would like it copied to more than one recipient
then you can separate multiple email addresses with commas, for
example:
<input type="hidden" name="recipient"
value="you@your.domain,me@your.domain">
NOTE: You will need to contact us to tell us the email address of
the recipient of the form and the URL of the form itself, please
email this information to webweaver@zetnet.net |
The subject line for the email. For example:
<input type="hidden" name="subject"
value="Form the feedback form"> |
If this value is present it should be a URL,
and the user will be redirected there after a successful form submission.
For example:
<input type="hidden" name="redirect"
value="http://www.your.domain/foo.html">
If you don't specify a redirect URL then instead of redirecting
formmail will generate a success page telling the user that their
submission was successful. |
| The background color for the success page. |
The URL of the background image for the success
page. |
| The text color for the success page. |
| The link color for the success page. |
| The vlink color for the success page. |
| The alink color for the success page. |
| The title for the success page. |
The target URL for a link at the end of the
success page. This is normally used to provide a link from the success
page back to your main page or back to the page with the form on.
For example:
<input type="hidden" name="return_link_url"
value="/home.html"> |
The label for the return link. For example:
<input type="hidden" name="return_link_title"
value="Back to my home page"> |
This sets the order in which the submitted form
inputs will appear in the email and on the success page. It can
be the string 'alphabetic' for alphabetic order, or the string "order:"
followed by a comma separated list of the input names, for example:
<input type="hidden" name="sort"
value="order:name,email,age,comments"> |
This is mainly used for debugging, and if set
it causes formmail to include a dump of the specified configuration
settings in the email.
For example:
<input type="hidden" name="print_config"
value="title,sort">
... will include whatever values you set for 'title' and 'sort'
(if any) in the email. |
This is a list of fields that the user must
fill in before they submit the form. If they leave any of these
fields blank then they will be sent back to the form to try again.
For example:
<input type="hidden" name="required"
value="name,comments"> |
| If this is set, it must be a URL, and the user
will be redirected there if any of the fields listed in 'required'
are left blank. Use this if you want finer control over the the error
that the user see's if they miss out a field. |
This is a list of the CGI environment variables
that should be included in the email. This is useful for recording
things like the IP address
of the user in the email. Any environment variables that you want
to use in 'env_report' in any of your forms will need to be in the
@valid_ENV configuration variable described above. |
| If this is set then fields that the user left blank
will be included in the email. Normally, blank fields are suppressed
to save space. |
| |
|
| As well as all these hidden inputs,
there are a couple of non-hidden inputs which get special treatment: |
| If one of the things you're asking the user to
fill in is their email address and you call that input 'email', formmail
will use it as the address part of the sender's email address in the
email. |
| If one of the things you're asking the user to
fill in is their full name and you call that input 'realname', formmail
will use it as the name part of the sender's email address in the
email. |