How to Make an HTML Email Form

Save

Website owners sometimes use HTML email forms to collect information from their visitors and send it to an email address. You might use an HTML email form on a "Contact Us" page where website visitors can submit a customer service question or feedback about your website. Alternatively, you might find HTML email forms useful for capturing sales leads, offering a newsletter sign-up option or providing a way to for visitors to register for an upcoming event. You need only a basic knowledge of HTML and forms to create a form for any of these purposes.

  • Choose a page on your website where your HTML email form will appear. Edit the HTML code for that web page in a text editor, Macromedia Dreamweaver or another application used for editing HTML. Begin your form using the "<form>" tag. Inside that tag, designate a method that equals "post" and an action that equals "mailto:" followed by an email address in quotation marks. The form will send submissions to this email address. For example, you might use:

    <form method="post" action="mailto:email@address.com">

  • Create the input fields for your form. Use the "input" tag to create each field. Inside that tag, designate a type that equals "text" for each text input field, such as the fields where you wish to capture the name and email address of the person who will fill out the form. Give each input field a unique name using the "name" attribute---this name will appear on the email you receive, along with the information that the form user entered in the field. Designate a length for each field using the "size" attribute in order to control the appearance of the input fields on your website form. For example, you might use:

    <input type="text" name="email" size="15">

  • Create a "submit" button using another input field with a type equal to "submit." Inside the tag, designate "submit" as both the name and the value of the field. For example, you might use:

    <input type="submit" name="submit" value="submit">

    End your form using the "</form>" tag. Upload the edited HTML code for your web page. Test your new form by completing the fields, submitting the form and checking your email address for the confirmation email.

Tips & Warnings

  • Though you can quickly and easily create an HTML email form, including your email address in a form action leaves you vulnerable to spam attacks from people who may find your address in the HTML code for your web page and add it to mailing lists. Most website developers now create form actions that refer to script files in which they have included the delivery email address, in order to hide it from public view.

References

  • Photo Credit submit button image by creative from Fotolia.com
Promoted By Zergnet

Comments

You May Also Like

Related Searches

Check It Out

Are You Really Getting A Deal From Discount Stores?

M
Is DIY in your DNA? Become part of our maker community.
Submit Your Work!