OS X:打开电子邮件客户端,创建新邮件并将文件添加为附件
我们希望让(Java)应用程序的用户尽可能轻松地向我们发送错误日志。首先,我们设想打开网站的错误报告页面,并使用要上传的文件的路径预填充上传输入字段,但出于安全原因,这不起作用。
是否可以在 OS X 上(命令行调用、Apple 脚本等)在默认电子邮件客户端中打开一封新电子邮件并添加某个文件作为附件?
We want to make it for users of our (Java) application as easy as possible to send bug-logs to us. First, we imagined to open a bug-report page of our website and prefill an up-load-input field with the path of the file to upload, but this does not work for security reasons.
Is it possible on OS X (command line call, Apple Script, what ever) to open a new e-mail in the default e-mail client and add a certain file as attachment?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以从命令行(终端)执行此操作。这是一个示例:
这将打开 Mac 邮件应用程序,创建一条消息并附加文件,准备发送。
You can do this from the command line (terminal). Here's an example:
This opens the Mac Mail app, creates a message and attaches the file, ready to send.
不幸的是,没有标准的方法来附加文件;您必须为用户安装的众多电子邮件客户端中的任何一个编写单独的脚本,并且假设他们实际上使用电子邮件客户端 - 例如,许多人使用 Gmail。
如果您无法将信息编码为文本,您可以自行通过 HTTP(S) 提交报告。有几个开源框架可以帮助解决此问题,例如 FeedbackReporter (使用 HTTP)和 < a href="http://zathras.de/angelweb/sourcecode.htm" rel="nofollow">UKFeedbackProvider(用于电子邮件)。
Unfortunately there's no standard way to attach a file; you'd have to write a separate script for any of the many email clients the user has installed, and that's assuming they actually use an email client—many people use Gmail, for example.
If you can't encode the information in text, you can just submit the report by HTTP(S) yourself. There are several open source frameworks that can help with this, such as FeedbackReporter (which uses HTTP) and UKFeedbackProvider (for email).
一定要是附件吗?您可以使用适用于任何操作系统和任何电子邮件客户端的 bog 标准
mailto:
URL 在消息正文中内嵌基于文本的信息。Does it necessarily have to be an attachment? You could inline text based info in the message body using the bog standard
mailto:
URL which would work in any OS and any email client.