Form2Mail (also known as FormtoMail or Form to Mail) allows people visiting your webpage to fill in a form which then sends the results to you via email.
 | If you have a domain name please note: If you want to use this script on your own domain name (e.g. www.yourdomain.com.au), you must first make an application to activate the script. This service is only available if your domain is hosted on Westnet's servers. |
Most webpage editors such as Microsoft Frontpage and Macromedia Dreamweaver have inbuilt form handling capabilities. If you are using different software, the two files below will guide you to implementing Westnet's free inhouse solution. It is assumed that you already have a reasonable understanding of forms and HTML coding.
Features of this form handler include:
- Required Fields
- Sorted Entries
- Blank Field Handling
- Plain text or Formatted email results
- Protection from spambot email harvesting
- Debug mode to see exactly what your form is sending
- Send copy to user
An example form is available to download and use for your testing. You must download the form and edit it with your email address for it to work.
- If you are looking for a basic form that includes name, email address and comments right click here and select "Save Target As..." to save the file on your computer. If you are looking for a more advanced form right click here and select "Save Target As..." to save the file on your computer.
- Copy the file if necessary to the working web directory on your computer or onto your web on Westnet's server.
- Ensure the one necessary field (recipient) is edited with your email address.
- Test the form.
Disclaimer: Westnet provides this script in good faith as a free service to its members. Whilst every care is taken to ensure the script is reliable and kept in a stable working condition, Westnet does not and can not guarantee an uninterrupted and error free service. The use of this script is at the user's own risk, loss of form results is possible. If you are not willing to accept these terms then do not use this script.
Using Form2Mail
It is assumed you are familiar with writing forms in HTML. If you need assistance with the syntax, you may like to use your internet search engine to find HTML language.
The beginning tags of your form should read:
One field is mandatory for the script to work which is:
New antispam feature: rather than using the "@" symbol in your recipient email address you may substitute with the "#" character instead eg username#westnet.com.au. This can have the desired effect of preventing email harvesting spambots collecting your email address from your webpage and making you the recipient of unwanted junk email.
Note however that this strategy will be pointless if your email address appears as normal on other pages within your website.
 | Very Important
Form field names must not contain any space characters
Example:
<INPUT TYPE="TEXT" NAME="FirstName"> is allowed
<INPUT TYPE="TEXT" NAME="First_Name"> recommended method
<INPUT TYPE="TEXT" NAME="First Name"> is not allowed - it contains a space |
| Input Name |
Input Type |
Description |
Default |
| Recipient |
hidden |
The only mandatory field required by the script. This is the email address the message is being sent to. To send the form to multiple recipients separate them with a comma. |
|
| Subject |
text/hidden |
Subject of the email message. Use input type=text if you want the user to be able to set the topic. |
WWW Form Submission |
| Email |
text |
Email address of the user filling out the form. This will ensure you have a "Reply To" address in your email client program if you need to reply to the person. |
|
| Required |
hidden |
Defines what input fields must be filled out by the user. Use a comma-delimited list for the field names. |
|
| Redirect |
hidden |
Full absolute URL that the script jumps to after the form has been submitted. Use this if you wish to display your own thankyou page rather than the script's built in default. |
|
| Sort |
hidden |
Defines the order in which the form results will appear in your email. Possible values: "alphabetic", "formorder" or comma separated list with all your field names in desired sequence. Note that form order is not guaranteed to produce the same order as fields appear on form. |
formorder |
| hide_blanks |
hidden |
Determines if you wish to hide non filled form values from appearing in your email. Possible values: 0 = display all fields, 1 = hide empty fields. |
1 |
| bgcolor |
hidden |
Background colour of the default display page. |
#FFFFFF |
| background |
hidden |
Background image of the default display page. Must be a full absolute URL. |
|
| text_color |
hidden |
Colour of text on the default display page. |
#000000 |
| font_face |
hidden |
Font face on default display page. |
Arial |
| font_size |
hidden |
Font size on default display page. Possible values: 1, 2 or 3 |
2 |
| link_color |
hidden |
Colour of links on the default display page. |
#0000FF |
| vlink_color |
hidden |
Colour of visited links on the default display page. |
#0000FF |
| alink_color |
hidden |
Colour of active links on the default display page. |
#0000FF |
| title |
hidden |
Title of the default thankyou page. |
Thank you |
| return_link_url |
hidden |
The full absolute URL for a page to continue to if using the script's own default thank you message. |
|
| return_link_title |
hidden |
The word(s) to appear as a link on the script's default thank you page to guide the user a continuing destination. |
Continue |
| formatted_email |
hidden |
Determines if you wish to receive the form results as plain text or formatted email. Possible values: 0 = plain, 1 = formatted |
1 |
| sendcopy |
radio button or check box |
Allows a copy of form data to be sent to the user filling in the form. A value of 1 will send copy, omission of this field or any other value will not produce a copy. |
0 |
| formtask |
hidden |
Required only if using the sendcopy option. The value of this field should reflect the purpose of the form. Some common examples of this might be order, feedback, holiday booking, questionnaire, room reservation etc. The value entered here will be used in the copy email to build the email subject and certain body text. |
|
| debug |
hidden |
Used for troubleshooting purposes, setting this value to 1 will display on screen all form names and values as received by the script for processing. No email is sent in debug mode. |
0 |
| env_track |
hidden |
This will provide the IP address (REMOTE_ADDR) and the browser USER_AGENT details of the person filling in the form. These details may be useful for tracing recurring spam and only appears in the recipient's email if the "sendcopy" option is used. A value of 1 will enable this feature. Ommision of this field or any other value disables tracking. |
0 |
 | Please note
The name of your Submit button should be "Submit" to prevent it appearing in your emailed results. The value of the button can be anything you want.
The underscore character if used in field names will appear as a space character for the purpose of tidier error messages for the user, eg "Last_Name" will appear as "Last Name" in a missing input error.
The default value, where applicable, will be used unless you explicitly assign a new value to any of the hidden input names.
Form field names are not case sensitive, however the way you spell them using uppercase and lowercase will impact on how they will appear in any error messages and returned email results. |