How to Create a Command Button on a Form That Automatically Attaches It to an Email
The HTML form "action" property lets you submit a form's input to an email address. You can do this action for a contact form, orders or any form where the user must communicate with you through our Web pages. The information contained in the form is sent to the specified email address in plain text, so you should only transfer non-critical data in an email message.
Instructions
-
-
1
Right-click the HTML page you want to edit, and select "Open With." Click the HTML editor in the list of programs to open your code.
-
2
Locate the form on your page body. If you do not already have a form set up, the following code shows you how to create a simple form that retrieves a reader's first and last name:
<form>
<input type="text" id="fname">
<input type="text" id="lname">
</form>
-
-
3
Add the form's "action" property and set the submission to your email address. The following code completes the form setup with your email address:
<form action="mailto:email@domain.com">
<input type="text" id="fname">
<input type="text" id="lname">
</form>
-
4
Add the command button to submit the form. Place the following code within the "form" tags:
<input type="submit" value="Submit Your Information">
When the user clicks this button, the form's "action" property triggers, and the form submits to your email address.
-
1