|
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.
Please note, the following instructions assume a working knowledge
of how to create web pages, web forms and general FTP/uploading issues.
Freeola can provide you with a basic form to use or you can create your own.
Click here to view the form code
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">
New
Options - Updated 17/12/07 - 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:
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.
 |
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.
Server Environmental Details: The
next new option is the ability for the server to send server
environmental
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.
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 - Updated 19/03/07 - 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 (as of
19/03/07) 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
|