html form guide
  about

How to get email from an HTML form submission

Your requirement is simple; you have created a form and want to get the information submitted in the form via email. However, getting this right is not very easy as it sounds. This article attempts to clear the misunderstandings that some people used to have about email forms.

email form html

Sending email directly from your form page

It would have been a nice feature for a web developer if the browsers let them route the form submission directly to an email address. But this is not the case. The reason is that if the browsers allowed emailing directly from the form page, that will reveal the visitors email address. A malicious hacker can collect the email address of the visitors to the web page and then spam them. In order to protect the web users, no client side language can send email without the user's intervention.

Is there an HTML Code to send email from a form submission?

There is no feature in HTML to send the form submission directly to an email address. There does exist an alternative; but this method is not very fool proof. The method is to use "mailto:" .

Using mailto:
You can set the action field of the form as 'mailto'. In this case, the web browser invokes the email client to send the form submission to the email address specified.

However, this method is not very compatible across browsers. It is not user friendly too; on form submission, it throws a warning message. Please see:
email form using mailto

Can JavaScript send the form submission to an email address?

No. JavaScript can't do email. If the client-side JavaScript allowed sending email programmatically, spammers will be the first to exploit it and you will hate your web browser!
Read More:
Can JavaScript email form submission?

Using a Form Mail script

The only right method to get the HTML form submissions to your email address is by using a form mail script.
A form mail script runs on your webserver. When a form is submitted, the form mail script collects the data submitted in the form, composes an email and sends the email to the address it is configured.

The form mail script should be written in a server side language that your web server supports(Perl, PHP, ASP etc)

Either you can write your own form mail script or use a pre-created form mail script. The following articles will help you in writing your own email form script:

You can use a pre-created, generic form mail script as well. There are many free form mail scripts available that you can configure and start using.

Read more about form mail scripts:
Using form mail scripts

  • Digg
  • del.icio.us
  • Netscape
  • Reddit
  • StumbleUpon
  • Technorati
  • YahooMyWeb


Related pages

 
  • Digg
  • del.icio.us
  • Netscape
  • Reddit
  • StumbleUpon
  • Technorati
  • YahooMyWeb
Email forms
  How to get email from html form submission

Email form using 'mailto'

Form to email using PHP

Email form with file attachment in PHP

Form mail scripts
  Form mail script selection guide

Perl based form mail

Contact Forms
  PHP based email contact form

Secure your HTML contact form using captcha
PHP Form
  PHP form validation script

PHP form tutorial: first steps

PHP form processing

PHP form 'GET'

PHP form 'POST'

Handling checkbox in PHP form processor

Handling select box in a PHP form

Using PHP_SELF in the action field of a form

How to submit a form using PHP

Creating a registration form using PHP

Making a login form using PHP

Creating a multi-page order form using PHP

Passing PHP form variables from one page to other

  Copyright © 2008 html-form-guide.com . All rights reserved.