电子:打开默认电子邮件客户端 [英] Electron: Open default email client

查看:117
本文介绍了电子:打开默认电子邮件客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用选举框架来构建.exe和.dmg文件。在应用程序中,我有一个按钮,单击它必须打开系统上安装的默认电子邮件应用程序才能发送电子邮件。
以下是打开电子邮件客户端的代码

I am using election framework to built .exe and .dmg files. In the app I have a button, clicking on which it must open default email application installed on the system to send an email. Following is the code to open email client

shell.openExternal("mailto:xyz@abc.com?subject=MySubject&body=");

但是,它仅在少数系统上有效。

But, it only works on few systems.

注意:已经检查其他系统也具有默认的电子邮件客户端。
还有更好的方法吗?那么,它将在所有系统上运行吗?
预先感谢您提供的帮助和宝贵的时间!

Note: It is already checked that other systems also have default email client. Is there any better way to do it. So, it will work on all system? Thanks in advance for providing help and your precious time !

推荐答案

不幸的是,代码 shell.openExternal( mailto:xyz@abc.com?subject = MySubject& body =); 仅启动MUA,该MUA在系统设置中被配置为默认值。通常,在较旧版本的Windows中,没有默认的邮件客户端设置,因此无论如何它都无法正常工作。

Unfortunately, the code shell.openExternal("mailto:xyz@abc.com?subject=MySubject&body="); only launches the MUA which is configured as the default in the system settings. Oftentimes in older version of windows there is no default mail client set and so it won’t work regardless.

这篇关于电子:打开默认电子邮件客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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