[英]JS/PHP : Email Compose and add attachment in Outlook
I have created one portal where I want to configure outlook with the portal. 我创建了一个门户,我要在其中配置Outlook门户。 There will be Email button where on click outlook should get open where subject, body and attachment should be added automatically based on data in the database.
将有“电子邮件”按钮,单击后将打开Outlook,并根据数据库中的数据自动添加主题,正文和附件。
I can open outlook and set subject and body but don't know how to add an attachment. 我可以打开Outlook并设置主题和正文,但不知道如何添加附件。
I have checked this link Javascript: Outlook but I am getting ActiveX exception but I believe this is more compatible with IE. 我已经检查了此链接Javascript:Outlook,但遇到了ActiveX异常,但我相信它与IE更兼容。 Also , Microsoft - Outlook
另外, Microsoft-Outlook
<html>
<head>
<script>
function myFunction() {
window.location.href = "mailto:test@test.com?subject=TestSubject&body=message%20goes%20here";
}
</script>
</head>
<body>
<button onclick="myFunction()">Open Outlook</button>
</body>
</html>
According to your description, you want to add an attachment with JS, you can use the following code: 根据您的描述,要添加JS附件,可以使用以下代码:
mailItem.Attachments.Add("your prfile url");
You need to set “Initializing and scripting ActiveX controls that are not marked as secure” to enabled. 您需要将“未标记为安全的ActiveX控件的初始化和脚本编写”设置为启用。
In IE 在IE中
This is the result of my running: 这是我跑步的结果:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.