mailto: links

Up until now, we have only put a URL for a web site or one of our files between the quotemarks in an <a href=""> tag.

It is possible to give an email address between the quote marks. For example, if I want to send email to henry@example.com, I would write a link like this:

<a href="mailto:henry@example.com">Send email to Henry</a>

It is also possible to add the subject line to the email. To add a subject line of Hello Henry to the preceding link, you would write it this way:

<a href="mailto:henry@example.com?subject=Hello%20Henry">Send email to Henry</a>

You have to change any blanks in the subject to a %20, or the validator won’t like your markup. (That’s a zero after the digit 2, not the capital letter “Oh.”)

Note that there is only one set of quotemarks in the href="" attribute. Do not insert another set of quote marks for the subject, or it won’t work properly.