How to Email a Form in HTML

How to Email a Form in HTML thumbnail
Use an HTML email form to collect simple user data

HTML email forms are useful because they enable you to collect simple user feedback without using a database. Visitors to your website can simply fill in an email form, click "Submit", and the browser will send an email to your email address. The email will contain the sender's name and the message that they entered in the body section of the email form. No coding knowledge is required to create a basic HTML email form, and it can be done in a matter of minutes.

Things You'll Need

  • HTML Editor
Show More

Instructions

  1. Instructions

    • 1

      Create a new HTML document.

    • 2

      Add the following lines of code below the "body" tag:

      <form action="MAILTO:SendTo@SomeEmail.com" method="post" enctype="text/plain">
      Name:<br /> <input type="text" name="name" value=" " />
      <br />Email Address:<br /><input type="text" name="mail" value=" " />
      <br />Message:<br />
      <input type="text" name="comment" value=" " size="60" />
      <br /><br />
      <input type="submit" value="Submit">
      </form>

      Site visitors will enter their name, email address and message to you in the three fields shown above. You can set the text values of these fields to anything that you like. For example, instead of using "Message", you could call it "My Comments to You". Do not change any of the values in any of the "input" tags.

    • 3

      Replace "SendTo@SomeEmail.com" with your real email address. This is where the browser will send the email. Because the "method" attribute is set to "post", the browser will send the information securely because the information will not appear in the browser's URL bar.

    • 4

      Open the HTML page in your browser, fill in the form values and click "Submit". The browser will send an email to the address that you entered in the "Action" attribute.

Tips & Warnings

  • Email spammers can harvest the email address that you enter in the "Action" attribute. If you are concerned about privacy, you might want to generate that address dynamically by using JavaScript. See Resources for more information.

Related Searches:

References

Resources

  • Photo Credit typing image by PD-Images.com from Fotolia.com

Comments

You May Also Like

Related Ads

Featured