How to make an ‘email this’ link in a webpage

The trick here is to do a mailto: link and pass URL-encoded parameters called “subject” and “body”. I found that the ridiculous Windows email client on this machine (which I never use except for testing this) doesn’t understand spaces encoded as “+”, it needs “%20″.

<a href=”mailto:?subject=This%20is%20the%20subject&amp;body=http://yoururlgoeshere/”>Email this</a>
The ampersand “&” between the parameters is HTML encoded which is a bit fussy but correct.
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