Code stuff about HTML on Aug 25, 2008 Write comment

Using mailto links in web pages

Yesterday, I found myself in a situation, wherein I wanted to provide a mailto link that will not only include a subject but also an initial body when a web site visitor clicks on the link.

I was quite sure that it was possible but couldn’t remember how to do it so after some googling, I found a “MailTo Syntax” page that describes how it’s done.

In the message body you can actually include html links that a person can email to friends. You’ll just have to url encode the text so that it will be properly included in the email message body when the user clicks on the link. If you need a url encoder, you can use this online form.