PageResource.com - Web Development Tutorials

The E-Mail Link

How to create an email link
To create an e-mail link on your page, all you need to do is use the standard link tag. The trick is in what you use as the address of the link. To force the browser to read it as an e-mail link, you use "mailto:" rather than "http://" to begin the address. After the "mailto:", you will use your e-mail address rather than a Web address, like this:

<a href="mailto:your_email_address">E-mail Me!</a>

Yes, all you need to do is replace the your_email_address with your e-mail address. Here is an example, to create an email link to myself, I might place something like [email protected] in that space, like this:

<a href="mailto:[email protected]">Give me some mail!</a>

Here is the resulting link:

Give me some mail!

If you click on the link, your browser will bring up a window for you to send an e-mail, with the e-mail address already filled in.

You can also create the subject of the message so the viewer doesn't have to fill in something in the subject line. You do this by adding a "?" at the end of your e-mail address and then your subject, like this:

<a href="mailto:[email protected]?subject=Hey John">Mail Me!</a>

The example link is below, notice that when you click it, the subject field of your email message is already filled in with "Hey John".

Mail Me!

Now, isn't e-mail fun?

All right, let's go to the next section, More on the E-mail Link.


Copyright © The Web Design Resource. All rights reserved. | Contact Us | Privacy Policy