How To E-Mail Form Data, PHP formmail
Freeola Internet Get Dotted Domains Chat & Gaming
Freeola.com The UK Internet Free Service Provider
Free Internet Access
 
Browse Support:
 Support Home Broadband Guides Dial-up Guides E-mail Guides Web Space Guides Domain Names Guides Misc Help Network Status Online Support System
 
 
Migrate to Freeola Broadband - absolutely Free of Charge!
Creating a Contact Form For Your Website


Welcome to the Freeola Internet customer support pages. This guide is designed to help with creating a PHP formmail script for your website. For more internet help topics please visit our main Support Page.

Freeola now offers a PHP form mail script for customers to use, this script will allow the contents of any form which you create, no matter how many fields you set up, to be submitted to your Freeola e-mail account.

Freeola can provide you with a basic form to use or you can create your own.

Click here to view the form code

The following instructions assume a working knowledge of how to create web pages, web forms and general FTP/uploading issues.

PLEASE NOTE: If you use third party Form-to-Mail scripts or custom made, please see the important information at the bottom of this page


The Form_To_Mail Script:

Once you have created your form you will need to set the action to connect to the form mail script. Open your form in a text editor such as Notepad on a Windows PC or BBEdit on a Macintosh. If for example your domain name is tomhoy.com the action will look like this:

<form method="post" action="http://tomhoy.com/cgi-bin/form_to_mail.php">

If you are using a Freeola500 address such as bob.spursfans.co.uk, the action will look like this:

<form method="post" action="http://www.bob.spursfans.co.uk/cgi-bin/form_to_mail.php">

Recipients:
Next you will need to set the recipient e-mail address; for anti-spamming reasons this must be an e-mail address hosted on the Freeola servers such as any Freeola500 e-mail address or any e-mail address which you have created on your domain name. If for example the address you wish to receive the e-mail on is bob@spursfans.co.uk, the recipient tag will look like this:

<input type="hidden" name="recipient" value="bob@spursfans.co.uk">

From:
You must also set the from field; this will be reflected in the "From:" field in your mail client, i.e. the sender of the email. So if you have more than one form you can easily see which is which. This must be set to a valid Freeola hosted e-mail address.

<input type="hidden" name="from" value="mywebsite@myfreeola.com">

Required Fields:
You can require certain fields in your form to be filled in before the results will get e-mailed to the recipient. Let's say you have a field called "email_address" and you don't want the form to send you an e-mail unless the viewer has filled in this section of the form. Enter the following code in the form and the form will return an error informing the viewer to fill in this section:

<input type="hidden" name="require" value="email_address">

You can add more than one required field by separating them with a comma:

<input type="hidden" name="require" value="email_address,name">

Redirecting:
Once the viewer has filled in the form and sent the e-mail, you can redirect the viewer to a thank you page. If you created a thank you page called "thank_you.html", you can redirect the viewer by adding the following code to your form:

<input type="hidden" name="success_redirect" value="thank_you.html">


Extra Options for Users of the Freeola Formmail Script

We have added some new options to the Freeola provided script. These options will allow you to personalise the script and obtain more information about which users have used your form. Your existing scripts should continue to run without alteration, however if you wish you can selectively add in the new options.

Spam Prevention via a Captcha Image:

Within your form you now have the option to specify that you want a verification page displayed before the email is sent, this will ask the user submitting the form to enter some numbers and letters as displayed on the screen before the submission will go through correctly. This is useful to stop spammers from using scripts to automatically send large volumes of email. This is also known as a PHP Captcha Image and is widely recognised as being one of the most effective ways of preventing unwanted replies from this form.
Verification To include this in your form you will need to add the following to your form section.

<input type="hidden" name="captcha" value="yes">

This will add a screen similar to the screenshot above which will not allow the person using the form  to submit it without specifiying the correct details.

User Agent Details:

The next new option is the ability for the server to send user agent details with the email that is sent. This can be useful for finding more information about the users who are using the script, including information such as the IP address of the machine visiting the page, the Operating System (OS) they are using as well as which web browser they are using to view your web page. To enable this, simply include the information below in your form, and the additional information will be included with the email that is sent.

<input type="hidden" name="env_report" value="yes">

Further Customization:

The next option allows you to further customise what a visitor to your site will see when they have not entered data in all the required fields. Include the information below in your form, and change the http://www.mywebsite.com/missing_fields.html to be the URL of the page you have created. Please note that unless you have included  the required fields option from above this will have no effect.

<input type="hidden" name="missing_fields_redirect" value="http://www.mywebsite.com/missing_fields.html">

The last of the new options allows you to specify a webpage for the visitor to see if for some reason the mail is not able to be sent. As before, change the http://www.mywebsite.com/missing_fields.html to be the URL of the page you have uploaded, and include the result in your form section.

<input type="hidden" name="fail_redirect" value="http://www.mywebsite.com/email_could_not_be_sent.html">



Important Information for Users of Third Party or Custom Scripts

If you want to use form to mail data, we recommend that you use the above method. However, if you already have another method, we need you to change some of the PHP or Perl code in order for the script to function.

If you are currently using a third party or custom Form-to-Mail script, you need to add a parameter containing '-f send_from_this@address.com' with the same address as in your 'From:' header (this must be a valid Freeola-hosted address). An example is provided below:

mail('send_to_this@address.com', 'subject', 'body', 'From: send_from_this@address.com', '-f send_from_this@address.com');

If you use Perl scripting, please make sure the following is added to the end of '/usr/sbin/sendmail' command.

-f send_from_this@address.com

Some perl scripts may not compile unless the @ symbol in the e-mail address is escaped. An example is provided below:

-f send_from_this\@address.com


To report a fault or get help, contact our support team Sales and support: 0871 210 9977 Email us a support request
Support lines open Monday to Friday 8:30am-8pm, & 9am-5.30pm weekends & Bank Holidays.
Calls cost 10p/minute for BT customers. Charges may vary from other networks/mobiles.
Go back to the Web Space & FTP page
MyFreeola Internet Settings Control Panel
Login or take a free look around.
Forgotten your password?
Free Account Sign-Up
 
Fantastic FREE Unlimited Services for every freeola internet
customer in the UK!
 
Register Domain Names. Buy from £2.99
e.g. yourcompany.com
or just yourcompany.
MORE ABOUT DOMAIN NAMES