问题描述
我想要一个这样的链接:
I'd like to have a link like so:
mailto:[email protected]?subject=email&body=TIMESTAMP
或
MATMSG:TO:[email protected];SUB:email;Body:TIMESTAMP;;
但是在主题行或正文中,我希望它包括以下任何选项:
But in the subject line or in the body, I'd like it to include any of these options:
- 时间戳
- 诸如消息号#"之类的消息排序,用于计算已使用的次数
- 任何乱码的唯一随机代码
我希望可以以某种方式从另一个网站(如此)导入内容.有没有办法使用独立链接来做到这一点?最终,我希望此链接可以与QR码一起使用.
I was hoping it would be possible to somehow import the contents from another website like this or something. Is there any way to do this using a stand alone link? Ultimately, I'm hoping this link can used with a QR code.
谢谢.
推荐答案
我认为有两种方法可以做到这一点:
At a glance I think there are 2 ways to do that:
-
使用javascript生成链接:
generate the link with javascript:
document.write('<a href="mailto:[email protected]?subject=email_' + new (Date().getTime()) + '"></a>');
或使用服务器端脚本生成链接,例如PHP:
or generate the link with server side scripting, for example PHP:
<?php
echo "<a href="mailto:[email protected]?subject=email_".round(microtime(true))."</a>"
?>
我个人会使用javascript,我认为它更适合此类内容.
Personally I would use javascript, I think it's more appropriate for this kind of stuff.
更好的方法是使用JavaScript书签,这样它就可以用作链接:
Even better is using a javascript bookmarklet, that way it can be used as a link:
javascript:location.href ='mailto:[email protected]?SUBJECT = Data& BODY = Code:'+ new Date().getTime()
这篇关于有没有一种方法可以使用mailto:链接,其中包含时间戳或某种独特的代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!