Introduction
Tutorials
Learn the basics with our online tutorials:
Quick start...
The quickest way to get started is with our low-cost Configuration Wizard.
This page describes how to configure an HTML form to use Tectite FormMail. You do this by changing some tags and adding some hidden fields.
If you know nothing about HTML forms, we recommend you use our Configuration Wizard to get a working sample HTML form. You can also check out our tutorials.
Alternatively, you can download a sample form with embedded instructions here.
Communicating With FormMail
Your HTML form communicates its requirements to formmail.php through a set of "hidden" fields, using HTML tags like this:
<input type="hidden" name="..." value="..." >
The data to be processed by formmail (e.g. the actual email of form results to send to you) comes from a combination of hidden fields and other form fields (i.e. data entry fields from the user).
Configuring Your HTML Form
Here are the steps to use formmail.php with your HTML form:
- Create your HTML form using standard HTML. Set the form tag's action attribute to the URL of your formmail.php.
- Ensure your HTML form has the following fields defined. These are
fields you expect the user to fill in:
- the user's email address
- realname
- the real name of the user
- Add some hidden fields to your form to tell FormMail what
to do with the form results (see below).
Typically, you'd specify recipients,
subject, and required,
as a minimum.
Once your form is working, you'd probably add good_url and bad_url. - Check that you've provided at least one of these fields:
- recipients
- logfile
- csvfile and csvcolumns
Hidden Fields
There's more!
This is not an exhaustive list: there are other hidden fields that FormMail recognizes for more advanced functions.
See the How-To guides for more features.
The following is a list of the hidden fields you place in your HTML form to instruct FormMail to perform various actions with form results.
a comma-separated list of email addresses that
the form results will be sent to. These must
be valid according to the TARGET_EMAIL configuration inside FormMail.
You would normally use the AT_MANGLE feature to hide
the email addresses from spambots.
You can also use email address
aliases.
From version 8.14 of FormMail, recipients can be an array. This allows you, for example, to use multiple-selection boxes or checkboxes to allow your users to easily select multiple recipients. For example, In the above examples, "moreinfo" would be an email address alias you define using EMAIL_ADDRS. |
|||||||||||||||||||||||||||||||||||||||||||||||||
a comma-separated list of email addresses that
the form results will be sent to as CC ("carbon copy") and
BCC ("blind carbon copy"), respectively. These must
be valid according to the TARGET_EMAIL configuration inside FormMail.
You would normally use the AT_MANGLE feature to hide
the email addresses from spambots.
From version 8.14 of FormMail, these fields can be arrays. This allows you, for example, to use multiple-selection boxes or checkboxes to allow your users to easily select multiple addresses. For example, |
|||||||||||||||||||||||||||||||||||||||||||||||||
a list of fields the user must provide, together
with a friendly name. The field list is separated
by commas, and you append the friendly name to
the field name with a ':'.
Note that field names and friendly names must not contain any of these characters: Advanced usage allows you to do the following:
In all the above ":name" is optional for any field. The "required" feature is a simplified way of doing some of what the "conditions" feature can do (see below). Only use "required" or "conditions" on your HTML forms, not both. (You can use both, but the Advanced Error Handling feature works best if you only use one of them.) |
|||||||||||||||||||||||||||||||||||||||||||||||||
a list of complex conditions, all of which must evaluate to true to allow the form submission to proceed. Conditions are a more powerful alternative to the "required" specification (see above). We recommend that you use the "conditions" feature or the "required" feature on your HTML forms, but not both. "Required" is simpler to use, but less powerful. The list of conditions is separated by a character you specify by the first character in the list. You specify the internal conditions component separator as the second character in the list, as follows: specifies that the conditions are separated by the colon character, and that internally, each condition's components are separated by the @ character. There are size limitations to HTML fields. Therefore, FormMail allows you to specify any number of conditions fields like this: A condition has this general format (spaces optional): COMMAND and MESSAGE are mandatory. MESSAGE is the message to display to the user if the condition fails. "@" is the internal separator that you specified as the second character of the conditions list. The tests are field comparisons, and have this general format:
OP is an operand. Tests are similar to the "required" specification, but the friendly field names are not supported (or needed, because you can provide a general message).
The available COMMAND values are:
Following are some examples of conditions.
|
|||||||||||||||||||||||||||||||||||||||||||||||||
a list of options to control FormMail when sending email. Options are:
Example: |
|||||||||||||||||||||||||||||||||||||||||||||||||
a mechanism for deriving form fields by
concatenating other form fields.
Operators are:
|
|||||||||||||||||||||||||||||||||||||||||||||||||
a mechanism for naming the files uploaded by the
form. By default, the files will be named with
user's original file name. This feature allows you
to provide different names.
The same facilities are available as for derive_fields.
|
|||||||||||||||||||||||||||||||||||||||||||||||||
the URL to redirect to on successful processing. |
|||||||||||||||||||||||||||||||||||||||||||||||||
the URL to redirect to on failed processing. |
|||||||||||||||||||||||||||||||||||||||||||||||||
this_form |
the URL of the form that's submitting the data; used with intelligent bad_url processing. |
||||||||||||||||||||||||||||||||||||||||||||||||
good_template |
a template file that FormMail can display on * successful processing. |
||||||||||||||||||||||||||||||||||||||||||||||||
bad_template |
a template file that FormMail can display on failed processing. |
||||||||||||||||||||||||||||||||||||||||||||||||
a string to use when expanding lists of values in templates. The default is comma. From version 8.27 of FormMail, you can specify certain HTML and other sequences to use. See TEXT_SUBS for more information. |
|||||||||||||||||||||||||||||||||||||||||||||||||
a subject line for the email that's sent to your
recipients.
|
|||||||||||||||||||||||||||||||||||||||||||||||||
a comma-separated list of environment variables
you want included in the email.
Note that this report is not available with HTML emails. However you can still access this information. To access this information and display it in your HTML, use the derive_fields feature. |
|||||||||||||||||||||||||||||||||||||||||||||||||
filter |
name of a filter to process the email before sending.
You can encode or encrypt the email, for example.
|
||||||||||||||||||||||||||||||||||||||||||||||||
comma-separated list of options to control the filter.
|
|||||||||||||||||||||||||||||||||||||||||||||||||
filter_fields |
comma-separated list of fields to filter. The behaviour of this specification can vary slightly depending on your other specifications. Refer to our How-To guide on Filtering for more information. |
||||||||||||||||||||||||||||||||||||||||||||||||
filter_files |
comma-separated list of file fields to filter. When your forms upload files, you can specify that the files are to be filtered. The resulting filtered files are stored in the repository or attached to the email. This feature is primarily designed for use with encryption filters, but works with any appropriate filter. This feature is available from version 8.24 of FormMail. |
||||||||||||||||||||||||||||||||||||||||||||||||
logfile |
name of a file to append activity to. Note that
you must configure LOGDIR for this to work.
|
||||||||||||||||||||||||||||||||||||||||||||||||
csvfile |
name of the CSV database to append results to. Note that
you must configure CSVDIR for this to work. You
must also specify the csvcolumns field.
|
||||||||||||||||||||||||||||||||||||||||||||||||
comma-separated list of field names you want to
store in the CSV database. These are the field
names in your form, and the order specifies the
order for storage in the CSV database.
From version 8.23 of FormMail, you can also specify formatting requirements with each field. Note, however, you must set LIMITED_IMPORT to false for the following format specifiers to work. The format specifiers are:
Example: |
|||||||||||||||||||||||||||||||||||||||||||||||||
comma-separated list of specifications for the Auto Responder feature. Specifications are:
You can specify either HTMLTemplate or PlainTemplate
or both. You can specify either HTMLFile or PlainFile
or both. If you specify a template as well as a plain file,
the plain file takes precedence and the template is ignored.
|
|||||||||||||||||||||||||||||||||||||||||||||||||
a comma-separated list of email addresses that
will be specified in the Reply-To header of the email.
According to the email standards, the Reply-To header in an email
is the address to which the recipient should reply.
You would normally use the AT_MANGLE feature to hide
the email addresses from spambots.
From version 8.14 of FormMail, replyto can be an array. This allows you, for example, to use multiple-selection boxes or checkboxes to allow your users to easily select multiple addresses. For example, |
|||||||||||||||||||||||||||||||||||||||||||||||||
alert_to |
email address to send errors/alerts to.
This feature is deprecated. The correct way to specify an email address for alerts is with the DEF_ALERT setting inside FormMail. |