是否有可能将文件附加到JavaScript中的电子邮件? [英] Is it possible attach a file to an Email in JavaScript?

查看:77
本文介绍了是否有可能将文件附加到JavaScript中的电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能存在重复:

通过mailto URI附加文件

我有一个HTML链接如

I have an HTML link like

<a href="mailto:someone@example.com?Subject=Hello">Send Mail</a>

当用户点击此链接时,我想在邮件客户端中附加一个文件。

I would like attach a file in the Mail Client when a User click the this link.

是否可以在JavaScript中使用或使用jQuery,html5?

Is it possible in JavaScript or using jQuery, html5?

推荐答案

尝试MS ActiveX:

You can try MS ActiveX:

var OA = new ActiveXObject('Outlook.Application');
var OAItem = OA.CreateItem(0);

var OAItemAtms = OAItem.Attachments;
OAItemAtms.add('http://foo.com/some_image.png');

您可以在这里阅读更多信息 - compose-and-使用前景来发送电子邮件

You can read more on this here - compose-and-send-e-mail-from-javascript-by-using-outlook

这篇关于是否有可能将文件附加到JavaScript中的电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆