如何发送javascript代码作为mailto href的主体

I want to do something like this.

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

//Code
$code = "<script type='text/javascript'>
                    // 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)
                    })();
                </script>";

I want to send this part as body so I have used this function to convert this text.

$email_body = urlencode(htmlentities($code));


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

So I am getting something like this in Body of Email Client

&lt; , &gt;

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

I want to deliver perfect text as body of mail.

How do I do that?

All email services "scans" the content of the emails in search of malicious code. As far as I know it's not going to work. Some email services also check links in email content for the same reason.

The result you see is because the email service escape characters (something like http://php.net/manual/es/function.htmlentities.php)