views:

4020

answers:

3

I have not had to mess with mailto links much. However I now need to add a link in the body of a mailto if it is possible.

Is there a way to add a link or to change the email opened to an html email vs a text email?

Something like:

<a href="mailto:[email protected]?body=The message's first paragraph.%0A%0aSecond paragraph.%0A%0AThird Paragraph.%0A%0ALink goes here">Link text goes here</a>
+1  A: 

It isn't possible as far as I can tell, since a link needs HTML, and mailto links don't create an HTML email.

This is probably for security as you could add javascript or iframes to this link and the email client might open up the end user for vulnerabilities.

GavinCattell
+10  A: 

Section 2 of RFC 2368 says that the body field is supposed to be in text/plain format, so you can't do HTML.

However even if you use plain text it's possible that some modern mail clients would render the resulting link as a clickable link anyway, though.

Alnitak
+3  A: 

Add the full link, with:

 "http://"

to the beginning of a line, and most decent email clients will auto-link it either before sending, or at the other end when receiving.

For really long urls that will likely wrap due to all the parameters, wrap the link in a less than/greater than symbol. This tells the email client not to wrap the url.

e.g.

  <http://www.example.com/foo.php?this=a&amp;really=long&amp;url=with&amp;lots=and&amp;lots=and&amp;lots=of&amp;prameters=on_it&gt;
scunliffe