Form Mailer is a WWW form to email gateway, that will parse the results of the submitted web form and email them to a specified user. This script has many options that can be specified - instructions for each of the options available are as follows:
| Step one |
Create an HTML page that contains the form to be mailed (eg. form.html)
|
|
| Field |
recipient |
| Description |
This is a mandatory form field that allows you to specify the person to whom you wish your form results to be mailed to. You can configure this option as a hidden form field where the value is your e-mail address.
This field MUST be present in order for the formmailer to work
Note: you cannot have more than one email recepient. |
| Syntax |
<input type=hidden name="recipient" value="email@mycompany.co.nz"> |
|
| Field |
subject |
| Description |
The email that is sent to you notifying you that your formmailer has been used, should have a Subject heading. To customize the email message "subject" field add one of the following: |
| Syntax |
If you wish to choose what the message subject is: <input type=hidden name="subject" value="Your Subject">
To allow the user to choose a subject: <input type=text name="subject">
If you don't configure this option, the subject heading will be the default title "WWW Form Submission" |
|
| Field | email |
| Description | This value allows the form user to specify their return e-mail address. This value will be put into the From field of the email message you receive, so that when you click on the Reply To button, the reply will be sent back to the formmailer user. |
| Syntax | If responding to enquiries from your web site is essential, it strongly recommended that this field is included. You can force all form users to fill this in by adding to it the "required" field (see below). <input type=text name="email"> |
|
| Field | realname |
| Description | The realname form field allows the user to input their real name. This field is useful for identification purposes and will also be put into the From line of the return email. |
| Syntax | <input type=text name="realname"> |
|
| Field | redirect |
| Description | If you wish to redirect the user to a different web page after they have finished filling out the form, you can use this hidden variable: |
| Syntax | To set the web page they will end up at enter the URL:
<input type=hidden name="redirect" value="http://www.mycompany.co.nz/thankyou.html">
To allow the user to specify the web page they wish to go to once the form is filled out: <input type=text name="redirect"> |
|
| Field | required |
| Description | You can require certain fields in your form to be filled in before the user can successfully submit the form. Simply place all the field names that you want to be mandatory into this field (separated by commas). If the required fields are not filled in, the user will be notified of what they need to fill in, and a link back to the form they just submitted will be provided. |
| Syntax | For example, if you want to require that they fill in the email
and phone field in your form, so that you can reach them once you have received the email, use a syntax like <input type=hidden name="required" value="email,phone"> |
|
| Field |
env_report |
| Description |
Allows you to have Environment variables included in the email message you receive after a user has filled out your form. This is useful if you want to know what browser they were using, what domain they were coming from or any other attributes associated with environment variables that might be useful.
REMOTE_HOST - Sends the hostname and domain of the person making a request.
REMOTE_ADDR - Sends the IP address of the remote host making the request.
REMOTE_USER - If the server supports authentication and the script is protected, this will give the username they have authenticated as. Note: this not usually set.
HTTP_USER_AGENT - The browser the client is using to send the request |
| Syntax |
If you wanted to find the remote host and browser sending the request, you would put the following into your form. <input type=hidden name="env_report" value="REMOTE_HOST, HTTP_USER_AGENT"> |
|
|
Field |
sort |
| Description |
This field allows you to choose the order in which your variables appear in the email that the formmailer generates.
By default the fields are left in the order they appear in on the browser. |
| Syntax |
You can choose to have the field sorted alphabetically or you can specify a set order in which you want the fields to appear in your mail message.To sort alphabetically: <input type=hidden name"sort"value="alphabetic">
To sort by a set field order: <input type=hidden name="sort"value="order:email,username,realname,etc…"> |
|
| Field |
print_config |
| Description |
print_config allows you to specify which of the config variables you would like to have printed in the body of your return email. By default, no config fields are printed. This is because most of the form fields such as email, subject, real name, etc are included in the email header. |
| Syntax |
If you want to print fields in the body of your email:<input type=hidden name="print_config" value="email,subject,etc.."> |
|
| Field |
print_blank_fields |
| Description |
print_blank_fields allows you to request that all the form fields are printed in the return HTML, regardless of whether or not they were filled in. The formmailer defaults to turning this function off, so that unused forms aren't emailed. |
| Syntax |
If you want to print all blank fields: <input type=hidden name="print_blank_fields" value="1"> |
|
| Field |
title |
| Description |
This allows you to specify the title and header that will appear on the Form Mail results page if you do not specify a redirect URL. |
| Syntax |
If you wanted a title of "Your Feedback Form Results": <input type=hidden name="title" value="Your Feedback Form Results"> |
|
| Field |
return_link_url |
| Description |
This field allows you to specify a URL that will appear on the page that is returned after a form is submitted if a redirect page has not been setup. |
| Syntax |
<input type=hidden name="return_link_url" value="http://www.mycompany.co.nz/index.html"> The return link will need a title so that it is visible on the web page. To add a title: <input type=text name="return_link_title" value="Back to Home Page"> |
|
| Field |
missing_fields_redirect |
| Description |
This form allows you to specify a URL that users will be redirected to if there are fields listed in the required form fields that are not filled in. This is so you can customize an error page instead of displaying the default. |
| Syntax |
<input type=hidden name="missing_fields_redirect" value="http://www.mycompany.co.nz/error.html"> |
|