简体   繁体   English

屏幕快照和Outlook电子邮件附件-Javascript实现

[英]Screenshot and outlook email attachment - Javascript implementation

I would like to implement a button that takes screenshot of a graph on the UI and attach that screenshot to an outlook email. 我想实现一个按钮,该按钮在UI上获取图形的屏幕截图,并将该屏幕截图附加到Outlook电子邮件中。 With this the user is able to send that attachment to other users instantly. 这样,用户便可以将该附件立即发送给其他用户。

This have to be done on single button click. 这必须在单按钮单击时完成。

Any ideas would be highly appreciated. 任何想法将不胜感激。

The best you have in classic javascript is the mailto protocol. 您在经典javascript中拥有的最好的就是mailto协议。 Unfortunately (in this case), it doesn't support HTML bodies or multipart content. 不幸的是(在这种情况下),它不支持HTML正文或​​多部分内容。 That means javascript itself won't help. 这意味着javascript本身将无济于事。

There are just a few options left: 只剩下几个选项:

  • If it is a company specific system, you could integrate with EWS to create a new email with attachment 如果是公司特定的系统,则可以与EWS集成以创建带有附件的新电子邮件
  • Ask the user to download and attach the file 要求用户下载并附加文件
  • (Don't EVER do this, it is the worst idea EVER) Use ActiveX and Outlook Automation objects to create an email and add the attachment. (永远不要这样做,这是有史以来最糟糕的想法)使用ActiveX和Outlook Automation对象创建电子邮件并添加附件。 This will only work on IE, and most companies will block this since it uses ActiveX. 这仅适用于IE,并且大多数公司都将其阻止,因为它使用的是ActiveX。 (As they should!) (如他们所愿!)

As a workaround you may consider taking a screenshot and then uploading it to your web server for further processing and sending emails. 解决方法是,您可以考虑截取屏幕截图,然后将其上传到Web服务器以进行进一步处理和发送电子邮件。 Also you can develop a plugin for browsers where you can do whatever you need. 您也可以为浏览器开发一个插件,您可以在其中执行所需的任何操作。 However, the end users must install it to be able to do whatever you need. 但是,最终用户必须安装它才能执行所需的任何操作。

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

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