使用AppleScript通过默认电子邮件客户端发送邮件附件

发布于 2024-09-09 19:23:26 字数 354 浏览 0 评论 0原文

是否可以通过用户的默认电子邮件客户端使用 AppleScript 发送电子邮件附件?我假设没有简单的方法可以做到这一点,因为程序本身必须实现 AppleScript,并且每个电子邮件客户端都会以不同的方式实现它,并且需要不同的脚本来发送带有附件的电子邮件。

我四处搜寻,只发现了这个: http://macscripter.net/viewtopic.php?id=12463

可以,通过 Applescript,给我默认电子邮件客户端的名称。以前有人研究过这个吗?

谢谢。

Is it possible in any way to send an email attachment through the user's default email client using AppleScript? I'm assuming there is no easy way of doing this, as the programs themselves have to implement AppleScript and every email client will implement it differently and require a different script for sending an email with an attachment.

I've searched around and only found this:
http://macscripter.net/viewtopic.php?id=12463

Which can, via Applescript, give me the name of the default email client. Has anyone looked into this before?

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雨巷深深 2024-09-16 19:23:26

你是对的。您必须为每个电子邮件客户端实现不同的 applescript 代码。因此,您可能希望限制您的应用程序将支持的电子邮件客户端,并向您的用户明确说明。

让它普遍工作的唯一其他方法是您实现自己的电子邮件系统。我有一个 python 脚本,我可以使用“do shell script”从 applescript 调用它来发送电子邮件。当然,您需要知道用户的信息(smtp 服务器、用户名等)。如果您有兴趣,可以在此处查看我的Python脚本。它不处理附件,但一些谷歌搜索应该告诉你如何修改它。

You are correct. You'll have to implement different applescript code for each email client. As such you'll probably want to limit the email clients your application will support and make that clear to your users.

The only other way for it to work universally is for you to implement your own email system. I have a python script that I can call from an applescript using "do shell script" to send emails. Of course you'll need to know the user's information (smtp server, username, etc). If you're interested you can see my python script here. It doesn't handle attachments but some google searching should show you how to modify it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文