Using Site Tools Form Mailer

What is the form mailer?

Our Form Mailer is a simple yet effective script to allow you to quickly and easily insert a form onto your Web Site which is then e-mailed back to you when someone completes a form on your site.

NOTE: This form is only available to customers on our Hosting Service - if you are not hosted with us, this form will not work at all. You can find out about our Hosting Services here.

How To Put A BASIC Form Mailer on your site:

1) Create a form like you would normally with your Web Site Design Program, or, insert this simple form template:

<form name="vpwsys-form-mailer" method="post" action="/public-lib/emailer/form-mailer.asp">
<p>Name: <input type="text" name="NameOfSender"></p>
<p> E-Mail Address: <input type="text" name="UserEMailAddress"></p>
<p>Message: <textarea name="MessageArea"></textarea></p>
<p><input type="submit" name="Submit" value="Submit"></p>
<input type="hidden" name="##SendToEMail" value="someone@example.com">
<input type="hidden" name="##SendToName" value="Test Person Name">
<input type="hidden" name="##SendFromEMail" value="someone@example.com">
<input type="hidden" name="##SendFromName" value="Test Person Sender">
<input type="hidden" name="##ConfirmationPageURL" value="http://shared.vpwsys.net/tools/emailer/done.asp">
<input type="hidden" name="##FailurePageURL" value="http://shared.vpwsys.net/tools/emailer/failed.asp">
<input type="hidden" name="##SubjectLine" value="My Subject Line Is Here">
</form>

2) If you used your normal program, you must insert the following special fields (if you copied our example above, these are already done.

<input type="hidden" name="##SendToEMail" value="someone@example.com">
<input type="hidden" name="##SendToName" value="Test Person Name">
<input type="hidden" name="##SendFromEMail" value="someone@example.com">
<input type="hidden" name="##SendFromName" value="Test Person Sender">
<input type="hidden" name="##ConfirmationPageURL" value="http://shared.vpwsys.net/tools/emailer/done.asp">
<input type="hidden" name="##FailurePageURL" value="http://shared.vpwsys.net/tools/emailer/failed.asp">
<input type="hidden" name="##SubjectLine" value="My Subject Line Is Here">

3) Again, if you used your own software, you must ensure the form is set to be submitted to the below - if you used our script above, it has already been done:

/public-lib/emailer/form-mailer.asp

4) Now we need to explain our special fields, and what you should put in them. Below is a list of lines and purposes:

##SendToEMail - The Address to SEND the completed form TO:
As it suggests, this is where the completed form will be sent once it has been filled in.

##SendToName - The Name of the Person/Group receiving the mail:
We recommend you enter the name (e.g "John Smith" or "Sales Team". This is not optional (many spam systems will rate your message as likely spam if it does not contain a sender name and e-mail address

##SendFromEMail - The Address the Form will appear to be from
You must set an address that mails appear to be from. To make it use the users "emailaddress" you must have a field called "UserEMailAddress". You should also set the value of this field to "USE-SENDER". By default this is OFF.

##SendFromName - The Address to SEND the completed form TO:
You must set an address that mails appear to be from. To make it use the users "emailaddress" you must have a field called "NameOfSender". You should also set the value of this field to "USE-SENDER". By default this is OFF.

##ConfirmationPageURL - Confirmation URL Page
When a user successfully sends a message to you using the online form, we then send the user to a "Confirmation" page. This is where you can place a page on your site and refer to the send as successful.

##FailurePageURL - Failure URL Page
When a user fails to send a message to you (for any reason) it will return this page. This is typically where the user did not provide information and you have the "USE-SENDER" features above switched on, or, alternatively you have missed a required field on your form.

##SubjectLine - Subject Line for the E-Mail
Enter a fixed subject line here. If you wish to use a customised subject line, you must enter "USE-CUSTOMSUBJECT" and then have a field called "SubjectLine".

USING SUCCESS OF FAILURE PAGES WHEN THE FORM IS SENT

As discussed above, we will take users to a customised page when they complete form submission. If you do not supply these, our default pages will be used. You should create 2 pages, one for successful attempts, and one for unsuccessful attempts, and upload them to your web site. Then update these lines:

<input type="hidden" name="##ConfirmationPageURL" value="http://shared.vpwsys.net/tools/emailer/done.asp">
<input type="hidden" name="##FailurePageURL" value="http://shared.vpwsys.net/tools/emailer/failed.asp">

NOTE: If you put a page at www.test.com/confirmation.htm, you should enter "/confirmation.htm", as / represents your domain name. Similarly, if you put the page at www.test.com/stuff/mypage.htm, you would enter /stuff/mypage.htm. There is no need to quote your domain name.

ADDING BASIC ANTI-SPAM FEATURES

To help guard against spammers using your contact form, you can add a basic Anti-Spam Challenge to the Form. This requires you to add an additional field into your form, and setup, or add information to a special file (called global.asa) that will contain a special magic word.

You don't have to add this, but we recommend you consider it.

Part 1 - Adding a Magic World field to your form

First, you'll need to add this field into your form:

<input type="text" name="##MagicWord">

This where someone filling in the form will provide the answer to your question - which is known as the Magic Word.

Here's a quick example of a form with a Magic Word field where the "magic word" is in fact a number. This is the easiest, but most readily defeated by a bot that can read that text:

Magic Word Example

A more advanced version would be this:

Magic Word Example 2

This is a simple answer that you'd expect a human to understand and thus complete correctly enabling your form to be sent.

Part 2 - Providing the answer using a "global.asa" file:

Now you'll need to add some information to your global.asa file - this is used by web sites that can support Classic ASP (all of our Windows Web Hosting does). If you've already got a global.asa file in the root of your web site, just add these lines:

Application("vpwSiteTool-FormMailer-UseMagicWord")=1
Application("vpwSiteTool-FormMailer-MagicWord")="your answer"

If you don't have a global.asa file, you'll need to create one - a template for this is below:

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart

'VPWSYS Site Tools
'============================

Application("vpwSiteTool-FormMailer-UseMagicWord")=1
Application("vpwSiteTool-FormMailer-MagicWord")="your answer"

End Sub

</SCRIPT>

You'll need to save this file as "global.asa" (not .asp!) in the root of your web site.

Part 3 - Make sure you've set the answer!

Just replace "your answer" with whatever the actual answer is to your magic word challenge. For example in our first example, it's clearly "6" and in the second "leaves".

TIP: Your answer will not be treated as case sensitive - but spaces and any punctuation do matter so think carefully about something people can answer easily enough.

CUSTOMISING THE SCRIPT FOR OTHER FORM ITEMS AND LAYOUT CHANGES

Because our script is flexible, you can add/remove any fields you wish, except those started with ##. You may layout the form however you wish, and use any form input type, providing it is valid. You may want to add a wide range of extra items to use. We recommend you review this site for more help with forms:

External Site: Advanced HTML for Beginners (ahfb2000.com)

UPLOADING YOUR FORM

If you do not currently use, and have never used our Site Tools on the Web Site in question, you must contact our HelpDesk to enable them. You can do this by raising a Support Request with us. This costs nothing, and gives you access to all of the site tools. You can check if you have site tools, by visiting your domain name plus /public-lib/ (so if your domain name was www.example.com, you would visit www.example.com/public-lib/ - if you do not see a welcome to Site Tools page, you are not yet enabled.

If you do not receive the test message, please check the above has been completed correctly before you contact support. You should also try taking the script in 1. above and uploading that to a new page, and just trying it as it is with only your e-mail address entered as the To address.


REMEMBER IF YOU ARE USING LINUX WEB HOSTING THEN THIS FEATURE IS NOT AVAILABLE BUT NUMEROUS ALTERNATIVES EXIST FOR YOU TO USE

 

Top

 

Popular VPWSYS Services:

Ad-Hoc Support - Support on Demand gives you the support you need in any aspect of your IT
Backup Services - From just £8.00 a month, affordable protection against loss of data
Domain Names - We provide Domain Name services from just £9.37 + VAT