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.
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:” .
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
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