how to send javascript code as body of mailto href
<p>I want to do something like this.</p>

<p>I have an analytics code in JS and I want to provide that code as body of an email by email button in <code>href="mailto:?body=code&amp;subject=code"</code></p>

<pre><code>//Code
$code = "&lt;script type='text/javascript'&gt;
                    // Define the site's unique id
                    var _siteId = 'xxx-id-xxx' || null;

                    (function()
                    {
                        // create a new script element with web-seal source
                        var script   = document.createElement('script');
                        script.type = 'text/javascript';
                        script.src   = '//s3.amazonaws.com/web-seal-dont-touch/webseal.js';
                        script.async = true;

                        // insert the script element into the document
                        var firstScript = document.getElementsByTagName('script')[0];
                        firstScript.parentNode.insertBefore(script, firstScript)
                    })();
                &lt;/script&gt;";
</code></pre>

<p>I want to send this part as body so I have used this function to convert this text.</p>

<pre><code>$email_body = urlencode(htmlentities($code));


&lt;a href="mailto:?body=&lt;?php echo $email_body; ?&gt;&amp;subject=Code"&gt;Send to Developer&lt;/a&gt;
</code></pre>

<p>So I am getting something like this in Body of Email Client</p>

<p><code>&amp;lt;</code> , <code>&amp;gt;</code></p>

<p>I know, I have converted the text but that is because of it was not accepting as href mailto body properly.</p>

<p>I want to deliver perfect text as body of mail.</p>

<p>How do I do that?</p>