How to Send Email From an HTML Page

An email contact link makes a good addition to nearly any type of website, giving visitors a means of sending questions or other forms of feedback to the site owner. Although adding a contact form into an HTML page might sound a little bit complicated if you are brand new to HTML, the truth is that sending email from an HTML page is actually pretty easy to do.

Instructions

  1. Use a Mailto Link

    • 1

      Decide which email address you want to receive the emails from your website.

    • 2

      Create the HTML page from which you want the users to be able to send an email.

    • 3

      Add an anchor tag that contains a mailto: link. It should look like this: <a href="mailto:abc@youremail.com">

    • 4

      Insert the email address you selected in Step 1 into the tag you just created, then type the text that you want to be clickable.

    • 5

      Type </a> to close the anchor tag. The final result should look something like this: <a href="mailto:abc@youremail.com">Contact Me</a>. You can now upload your HTML page to your server, and website visitors will be able to click on it to send you email.

    Use a Form

    • 6

      Create an HTML form using either a hard-coded HTML document or an HTML editor such as DreamWeaver or Nvu, including fields for the information you wish to collect from the users (such as name, email, etc).

    • 7

      Set appropriate value or name attributes to each input tag in your HTML form in order to ensure that you can identify and understand the data properly when you receive it.

    • 8

      Locate a form mail script. Your Web host may have pre-set scripts available through your hosting plan. If you do not already have access to an existing form mail, search for a free form mail CGI script on the Internet, then follow the instructions to customize the script and upload it to your server. Add any necessary variables, such as setting up the email address that should receive the form results.

    • 9

      Set the action attribute of your form tag to point to the location of your script and the method to either "post" or "get" as specified in the form setup instructions.

    • 10

      Add any necessary hidden variables and input fields to your HTML form that are required in the script setup instructions.

    • 11

      Upload your HTML form to your server in the correct location, double-checking that you have set up the action attribute to correctly point to your form script.

    • 12

      Send a test email to yourself using the form and make sure that it works correctly.

Tips & Warnings

  • In order to use any kind of CGI form mail script, you will need to have access to a CGI bin on your Web host. Most paid hosting plans should include this feature, but free Web hosting accounts may not.

Related Searches:

Comments

You May Also Like

Related Ads

Featured