Create a website RSS feed

Linking To E-mail Addresses

Linking to E-mail Addresses

Last update on: 05-14-2008
You have probably seen links on many sites that show an e-mail address, and you have probably noticed that clicking one of these links will opens a new e-mail in your default e-mail program, ready for you to send an e-mail to that address. Some even contain subject lines.

To create a link to an e-mail address you need to use the following syntax with the <a> element:

<a href="mailto:name@example.com">name@example.com</a>

Here, the value of the href attribute starts with the keyword mailto, followed by a colon, and then the e-mail address you want the mail sent to. As with any other link, the content of the <a> element is the visible part of the link shown in the browser, so you might choose to use the following:

<a href="mailto:name@example.com">E-mail us</a>.

Or, if you want users to see the e-mail address before clicking it, you can use the following:

For sales enquiries e-mail <a href="mailto:name@example.com">sales@example
.com</a>.
There is one drawback to using this technique, however: some less scrupulous inhabitants of theWeb use little programs to automatically search Web sites for e-mail addresses. After they have found e-mail addresses on Web sites they will start sending spam (junk mail) to those addresses.

hypertext links's lessons:

Basic Links
Linking To E-mail Addresses
Destination Anchor

Banner HomeServices Contact |  ©2009 http://www.iteachweb.net/