How to make an email link using “mailto:”

Often you see links which open up your email program with the address already filled in for you. Here’s how you do it:

<a href=”mailto:bob@example.com”>bob@example.com</a>

You can fill in the subject and text for the body of the email too. Note that some characters (notably spaces) must be encoded. Here the spaces are replaced with “%20″ and the ampersand is encoded to be valid HTML:

<a href=”mailto:bob@example.com?subject=Hi%20there!&amp;body=Hi%20Bob%20and%20goodbye”>bob@example.com</a>
Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

Leave a Comment