简体   繁体   English

JS / PHP:在Outlook中通过电子邮件撰写和添加附件

[英]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.

相关问题 通过JS附加到Outlook中 - Attachment in outlook through JS 如何从 Node.js Outlook 加载项中的 Outlook 邮件获取附件内容? - How can I get attachment content from an Outlook mail in a Node.js Outlook add-in? Outlook Web Add In with Graph API - Is it possible to include current item as an attachment when forwarding/sending an email? - Outlook Web Add In with Graph API - Is it possible to include current item as an attachment when forwarding/sending an email? 屏幕快照和Outlook电子邮件附件-Javascript实现 - Screenshot and outlook email attachment - Javascript implementation 用JS送outlook email? - Send outlook email with JS? 将附件添加到ActiveX Outlook(2016)邮件 - Add attachment to ActiveX Outlook (2016) mail Outlook加载项使用Java脚本将附件保存到磁盘 - Outlook Add-In save Attachment to Disk with Javascript 使用 Javacsript/jQuery/Ajax/C# 打开带有附件的撰写电子邮件 - Open compose email with an attachment using Javacsript/jQuery/Ajax/C# 在桌面Outlook中打开时,附件电子邮件以撰写模式显示 - The attached email appears in compose mode when open in desktop Outlook 如何使用 VBA 在 Office 365 Outlook 中撰写电子邮件? - How to compose email in office 365 outlook using VBA?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM