How to create a 'mailto' feedback form

There are several ways of adding a feedback form to your website. The most usual is to create a form in a web page and write the HTML such that, when submitted, the form is passed to the URL of an application on the server. This application pulls out the important parts of the form and stores them for viewing by the website owner.

An alternative, simpler, approach is to specify that the form is passed to a 'mailto' URL which contains your own email address. The form is then automatically mailed to you.

The advantage of this is that it works with any old web server and does not require any special applications to be written or run on the server.

The one, slight, disadvantage of this approach is that, if the end user has not got their browser set up to use a mail service, it will not work for them. However, this is not usually a problem.

How to do it

You need to create a web page which includes the feedback form. The form, itself, is specified in HTML as follows: <FORM action="mailto:steve.m.west@btinternet.com" method=post enctype="text/plain"> .....stuff </FORM> You will see that the 'form' tag at the start of the form includes an 'action' qualifier. This specifies what is to be done with the form when the user submits it. In this case, 'mailto:' specifies that the form will be mailed to an email address. The address here is steve.m.west@btinternet.com. Obviously you need to put your own email address here, otherwise I will receive all your feedback forms! 'Method=Post' specifies the technical protocol for sending the data (don't change this). The 'enctype' qualifier specifies how the contents of the form is to be encoded. In this case it will be plain text in the body of the email message (don't change this either!)

That's all there is to it!

So a complete form, with fields and buttons might look like this:

<FORM action="mailto:steve.m.west@btinternet.com" method=post enctype="text/plain"> Your comments: <br> <TEXTAREA cols=40 name=Comments rows=10 wrap=VIRTUAL></TEXTAREA> <br> Your name: <br> <INPUT name=Name> <br> Your Email Address: <br> <INPUT name=email> <p> <INPUT type=submit value="Submit Form"> <INPUT type=reset value="Clear the Form"> </FORM> To see this in action on a web page, click here

Please feel free to steal the HTML skeleton of the form, given at the above link. If you click here then select 'View source' in your browser, it should be fairly self-explanatory.

Whenever someone submits the form, I receive an email which looks something like:

Comments=Whatever they typed in the comments box
Name=Fred Bloggs (or whatever they typed in the Name box)
email=fred.bloggs@isp.net (or whatever they typed in the email box)