Mailto body, special characters?

Tag: mobile , mailto Author: wkjgc19780407 Date: 2010-06-22

I'm trying to have a mailto: body with multiple paragraphs and a URL. I should probably note this is for a mobile web application.

  1. Is there a reason why I can't use \n (even inside JavaScript strings) for new lines? Instead, I'm using %0D%0A.

  2. I'd like to enclose my URL in <>'s so email clients can properly identify it as a URL, but when I try to do that the entire URL doesn't show up at all in the body. Is it being escaped, or something? How do I fix this/use <>'s to wrap it?

Thanks!

Don't know about the first question, but you probably need to use HTML entities &lt; for < and &gt; for > in order to get them into your HTML document correctly.
Hmm..still doesn't work. It just makes the entire URL (plus the <>'s) disappear.

Best Answer

have you tryed encoding the values with javascript?

eg

<a href="[email protected]?subject='+encodeURI('emailSubject')+'&body='+encodeURI('emailBody')+'">