Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass an URL in mailto's body

Tags:

html

css

url

mailto

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>
like image 289
Simer Twilio Toronto developer Avatar asked Jan 17 '11 05:01

Simer Twilio Toronto developer


People also ask

How do you put a link in a mailto body?

On the Insert tab, click Link or Hyperlink. Under Link to, click E-mail Address. Either type the email address that you want in the E-mail address box, or select an email address in the Recently used e-mail addresses list. If you want to change the link text, in the Text to display box, type the text.

How do I pass HTML body into mailto?

The Mailto format does not support HTML code emails. Outlook was used at 2003, but to become compliant with the mailto: standard they removed that functionality. But you can Use %0D%0A for a line break in HTML body.

Can mailto be a URL?

A mailto link is a Uniform Resource Identifier (URI) scheme for email addresses. It is a type of HTML or URL link that activates the default mail client (Gmail, Outlook etc.)


2 Answers

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>
like image 174
Matt V. Avatar answered Sep 20 '22 02:09

Matt V.


I would URL encode the link you are using, so it would be:

<a href="mailto:[email protected]?body=Link%20goes%20here%20http%3A%2F%2Fwww.example.com%2Ffoo.php%3Fthis%3Da%26join%3Dabc%26user454">Link text goes here</a>
like image 32
tekknolagi Avatar answered Sep 22 '22 02:09

tekknolagi