Stu*_*ule 109 html mailto email email-integration
我没有太多关注mailto链接.但是,如果可能的话,我现在需要在mailto的主体中添加一个链接.
有没有办法添加链接或更改打开到HTML电子邮件与文本电子邮件的电子邮件?
就像是:
<a href="mailto:test@test.test?body=The message's first paragraph.%0A%0aSecond paragraph.%0A%0AThird Paragraph.%0A%0ALink goes here">Link text goes here</a>
Run Code Online (Sandbox Code Playgroud)
scu*_*ffe 32
添加完整链接,包括:
"http://"
Run Code Online (Sandbox Code Playgroud)
到一行的开头,大多数像样的电子邮件客户端会在发送之前自动链接它,或者在接收时自动链接它.
对于可能由于所有参数而包装的非常长的URL,将链接包含在小于/大于符号中.这告诉电子邮件客户端不要包装URL.
例如
<http://www.example.com/foo.php?this=a&really=long&url=with&lots=and&lots=and&lots=of&prameters=on_it>
Run Code Online (Sandbox Code Playgroud)
据我所知,这是不可能的,因为链接需要HTML,而mailto链接不会创建HTML电子邮件.
这可能是为了安全,因为您可以向此链接添加javascript或iframe,并且电子邮件客户端可能会打开最终用户的漏洞.
请在IE下面查看以下javascript.不知道其他现代浏览器是否可行.
<html>
<head>
<script type="text/javascript">
function OpenOutlookDoc(){
try {
var outlookApp = new ActiveXObject("Outlook.Application");
var nameSpace = outlookApp.getNameSpace("MAPI");
mailFolder = nameSpace.getDefaultFolder(6);
mailItem = mailFolder.Items.add('IPM.Note.FormA');
mailItem.Subject="a subject test";
mailItem.To = "an@email.here";
mailItem.HTMLBody = "<b>bold</b>";
mailItem.display (0);
}
catch(e){
alert(e);
// act on any error that you get
}
}
</script>
</head>
<body>
<a href="javascript:OpenOutlookDoc()">Click</a>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
152695 次 |
| 最近记录: |