Web Hosting - Email Form Processing
To have the server process your form and turn it into an email, you will need at least 3 files, possibly 4:
- Your HTML page with the form to be filled out
- Our formmail.php file. (You shouldn't need to edit this file.)
- A "params" file. Download our default file.
- (optional) A "format" file that is used as the body of the email message that is sent.
The "FORM" tag for your form should use the following attributes:
<form action="formmail.php" method="POST">
The only required field inside the form is a "params_file" form variable:
<input type="hidden" name="params_file" value="emailform.txt">
The params file contains all the required and optional settings to process the form. Read through our default params file. We've tried to heavily comment the options.
Some of the features of this form to email script:
- Hard code sender email address or pick up address from any form field.
- Optionally specifiy a format file (mail merge type operation) to customize the body of the message.
- Optional acknowledgement email sent to address picked up from any field.
- Optionally use format file to customize body of acknowledgment email
- Take file uploads
- Report on users browser, IP address, etc.
- Ban List to prevent certain users from submitting your form
- Required fields.
- Verify the formatting on email, zip code and phone number fields.
When the form is processed, the server will look for the params file specified and read in the parameters.
For the body of the message, a "format" file can be specified and should be placed in the same folder as the form HTML page.The content of the format file, when processed, will become the body of the email message that is sent. A "merge" type operation occurs with this file to replace the tags with data from the submitted form.
A format file contains text/merge information like so:
Name: [form_param:'name']
Email: [form_param:'email']
Subject: [form_param:'subject']
Favorite iMac Color: [form_param:'FavColor']
Comments: [form_param:'comments']
Your params file optionally can also be your format file. See the bottom of our default params file linked above for an example. This makes less files for you to manage.