2

Is it possible to embed html in a message body generated by a mailto link? And/or embed pictures or JavaScript as well? If yes, can you provide an example (it doesn't need to be encoded)?

Also, which other things can I do and which important things can't I do?

JMax
  • 26,109
  • 12
  • 69
  • 88
Żubrówka
  • 730
  • 1
  • 10
  • 24
  • See the answer to [this question](http://stackoverflow.com/questions/247245/is-it-possible-to-add-an-html-link-in-the-body-of-a-mailto-link), note that the RFC linked to on that page has been obsoleted by [RFC 6068](http://tools.ietf.org/html/rfc6068), which agrees that the `body` attribute is 'intended' for the plain text part of the email, although some user agents may use it differently (but they probably won't). – Rebecca Scott Sep 20 '11 at 12:33

1 Answers1

3

Yes, you can!

mailto:info@rok-kralj.net?cc=someone@at.com&bcc=ccc&subject=test&body=%3Cb%3Etest%3C%2Fb%3E

You can post a lot in the body, you just have to escape tags with html entities, like > < ". And I believe there is a URL length limit.

Oh, and don't forget to urlencode at the end!

Rok Kralj
  • 46,826
  • 10
  • 71
  • 80
  • Rok, can you provide an example where there is some text in bold in the body? – Żubrówka Sep 02 '11 at 12:00
  • I believe it is like this: mailto:info@rok-kralj.net?cc=someone@at.com&bcc=ccc&subject=test&body=%26lt%3Bb%26gt%3Bdddf%26lt%3B%2Fb%26gt%3B – Rok Kralj Sep 02 '11 at 12:01
  • also try `mailto:info@rok-kralj.net?cc=someone@at.com&bcc=ccc&subject=test&body=test` – Rok Kralj Sep 02 '11 at 12:07
  • Hmm, doesn't seem to work: I just got raw text in my e-mail client. However, when I tried something like mailto:info@rok-kralj.net?cc=someone@at.com&bcc=ccc&subject=test&body=hello<strong>world it shows until the test part, so it seems that it is eating some html... – Żubrówka Sep 02 '11 at 12:10
  • Hmm, tried with Outlook Express and Lotus Notes and none of them seem to work... So I'm just supposing that e-mail clients don't like the taste of html there – Żubrówka Sep 02 '11 at 12:23
  • Let us try like this: `mailto:info@rok-kralj.net?cc=someone@at.com&bcc=ccc&subject=test&body=%3Cb%3Etest%3C%2Fb%3E` :) Have you noticed my second example? I will update the answer once you tell what works for you! – Rok Kralj Sep 02 '11 at 12:24
  • After all the testing I guess it is not anymore available due to security measures. Well, it still depends on the client. Some may still support it. – Rok Kralj Sep 03 '11 at 10:10