html lesson 19

email links

Another type of link we can put on our web pages is an email link. Here's how:

<a href="mailto:somebody@microsoft.com">email us</a>

And the result be like this link: email us. If you have an email client like "outlook" or "outlook express" or something similar, then click it and see what happens.

You can add extra elements to this, such as the cc(carbon copy), bcc, subject etc..... like so:

<a href="mailto:somebody@microsoft.com?
cc=somebodyelse@microsoft.com&
bcc=andsomebodyelse@microsoft.com&
subject=a subject for you&
body=Hey there, what's goin on dude? oops sorry wrong number!" >email us</a>

Now see what happens when you click email us.

Of course I should point out that putting your email address anywhere on your webpages, whether in a link or not, is just begging for your inbox to bombarded with all sorts of unwanted spam emails as if we don't get enough already. Don't say I didn't warn you.

If you decide not to stop at simple html and you come along with me when I write my up and coming php tutorials, I'll teach you how we can collect data, communication and feedback from our viewers without exposing your email address to the public world of spammers. Unfortunately this won't stop all the existing spam we recieve, but hey, why hand them the key to send you a lot more?


When you're ready, click here to continue on to lesson 20 and I'll show you how to use an image as button for a link.


Lesson added Tuesday 22nd July 2008, updated Tuesday 5th August 2008.