简体   繁体   English

如何将捕获的URL传递给HTML中的电子邮件正文

[英]How to pass captured URL to Email Body in HTML

I am stuck at one place, i want to capture the url and print into the email body through HTML but not able to do the same. 我被困在一个地方,我想捕获URL并通过HTML打印到电子邮件正文中,但不能这样做。 Request you to help on this. 要求您提供帮助。 code is below.... this code is auto generated by a device i am just modifying to my need. 代码在下面...。此代码是由我根据需要修改的设备自动生成的。

<html>
This site has been blocked. If you believe this is an error,<br>
kindly contact to Mr. ABC - +9112345678
<br>Or you may <a href="mailto:abc@gmail.com?cc=xyz@gmail.com&subject=Google Website $$Category$$&body=<script>document.write(document.URL);</script>">Send Email</a>
</html>

How about passing the href value with JS? 如何通过JS传递href值?

<a id="Mail" href="#">Send Email</a>

<script>
    (function() {
        var mail = document.getElementById("Mail");
        var url = window.location.href;
        var href = "mailto:abc@gmail.com?cc=xyz@gmail.com&subject=Google Website $$Category$$&body=" + url;
        mail.href = href;
    })();
</script>

for this you can try this code to pass url to E-Mail body. 为此,您可以尝试将此代码传递url到电子邮件正文。

<a href="mailto:test@test.test?body=Link goes here http%3A%2F%2Fwww.example.com%2Ffoo.php%3Fthis%3Da%26join%3Dabc%26user454
">Link text goes here</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM