|
|||
|
|
|||
|
|
Sending form submissions to email using 'mailto:'The simplest method to get the form submissions posted to you via email is by using "mailto:" in the action field of the form. However, this method has many drawbacks.First let us see how we can use 'mailto' in a form. How to set up 'mailto' in your HTML formIn the action field of the form, set the action as "mailto:youremailaddress" for example:
In Internet Explorer 6, on submitting the form it throws a message as shown below:
What is POSTDATA.ATT?When a form is submitted using the "mailto:" method, outlook express sends the submitted form data as an attachment POSTDATA.ATT. It is simply a text file and you can open it using notepad. However the file will contain the submitted form data in somewhat cryptic format.If the form contains fields: 'Name', 'Email', 'Address' and submit, POSTDATA.ATT for a sample submission looks like this:
How to get the form data in plain textAs you saw, it is difficult to read the POSTDATA.att. You can make the form data sent to be in readable form by making a small change in the form.Add 'enctype=text/plain' in the form attributes. The form code becomes:
When this form is submitted, you will get the email in readable form. Like this:
How to show a 'Thank You' pageYou have successfully submitted the form. Now you want to show a confirmation page to the visitor that the form is submitted. Here is how to do it:Suppose the name of the confirmation page is thanks.html Update the code for the form tag to:
How to customize the subject of the emailBy default, the subject of the email that you receive from such a form will read something like: "Form posted from Microsoft Internet Explorer"The following code shows the change:
Drawbacks of 'mailto' email formWe have seen that using mailto is simplest way to get your HTML form submissions via email.However, there are many disadvantages for this method.
Use a form mail scriptThe only consistent alternative to ensure that you get the email form the form submissions is to use a form mail script.See: Using form mail scripts
Related pages |
| Copyright © 2008 html-form-guide.com . All rights reserved. | ||||