build-website-header
spacer-image
 

Contact Forms- Email Contact Mechanisms

In the early days of the web most sites used the mailto tag to send email.

This looks like a simple hyperlink but when you click the link the default email client is launched with the destination address already completed. Here is an example link

contact us

 Below is the HTML code for the above link.

<a href="mailto:steve@doesnotnexist.com?subject=Feedback">contact us</a>

This is still used but results in a tremendous amount of spam. So it is often replaced with an encrypted link.

There are number of free tools that generate an encoded email address that appears as meaningless text to an email extractor, but displays correctly in the browser and works correctly when clicked.

 The tools usually have a web interface where you enter your details in a simple form and the code is generate automatically for you. You then copy and paste the encoded text on to your web page. The one I have used is at-

http://hivelogic.com/enkoder/form

The problem with this method is that it still relies on a correctly configured email client on the sending machine. Most PC users have one but if you are using this type of form from a PC in an Internet cafe ,or from a friends, machine then it doesn't work.

Using A Form

On most websites a contact form is the most common way of obtaining feedback from visitors. It is far more flexible than the email method and has the added advantage that you can Prompt the visitor for various types of comments turning the contact form into a mini poll.

Until recently the form method was also quite immune from spam attacks. However the spam harvesting tools have become more sophisticated and so most web masters are using some form of form protection which we will discuss later. (so called captcha scripts)

If you are unfamiliar with forms you should first read the articles on website forms.

The way most forms work is that the visitor fills out the form and clicks submit. Then the form is processed by either.

  • A JavaScript routine on the client or
  • A PHP (ASP,perl etc) script on the Server
  • Both

The purpose of the JavaScript is usually to verify the form fields before the form is sent to the server for processing, but it can also be used to counter spam programs.

The PHP script on the server takes the information from the form and in the case of a contact form assembles it into an email that is then send to the contact address. The php script can also be used to counter spam programs.

The form consists of two ( or 3 ) parts.

  • The form itself that the visitor sees on the page- part 2
  • A mandatory Server side (PHP usually) script that processes the form and send the email. part 3
  • An optional JavaScript script that does some form checking - part 4

We will look at these in more detail in the next section.

Related Articles and Resource:

 

Google
Web www.build-your-website.co.uk


 

spacer2-image