How to pass an URL in mailto's body

Simer Twilio Toronto developer picture Simer Twilio Toronto developer · Jan 17, 2011 · Viewed 32k times · Source

I need to send an URL of my site in the body so the mail recipient can click on that to join my site.

However currently mail client renders the mail like this:

Link goes here http://www.example.com/foo.php?this=a

The URL is truncated on the & symbol, thus the whole process of joining failed. How can I pass the URL like http://www.example.com/foo.php?this=a&join=abc&user454 in mailto body?

My current HTML is the following:

<a href="mailto:[email protected]?body=Link goes here http://www.example.com/foo.php?this=a&amp;really=long&amp;url=with&amp;lots=and&amp;lots=and&amp;lots=of&prameters=on_it
">Link text goes here</a>

Answer

Matt V. picture Matt V. · Jan 17, 2011

You need to encode the URL. This URL Decoder/Encoder tool will do the trick. The following seems to work:

<a href="mailto:[email protected]?body=Link goes here http%3A%2F%2Fwww.example.com%2Ffoo.php%3Fthis%3Da%26join%3Dabc%26user454
">Link text goes here</a>