【问题标题】:Does Outlook 2011 allow attachments through mailto link?Outlook 2011 是否允许通过 mailto 链接发送附件?
【发布时间】:2014-01-15 20:15:36
【问题描述】:

我正在尝试在 OS X 上通过mailto 开始撰写新邮件。我已将默认电子邮件客户端设置为 Outlook,因此我可以使用预先配置的邮件打开 Outlook,如下所示:

open 'mailto:SomeEmail@example.com?subject=hey&body=how are you doing'

但我还希望能够使用mailto 链接将附件添加到预配置的消息中。我尝试了以下方法:

open 'mailto:SomeEmail@example.com?subject=hey&body=how are you doing&attachment=/Users/myName/Desktop/testFile.rtf'

但是当 Outlook 打开时,没有附件。我已阅读mailto 链接是否允许附件取决于客户端。有谁知道 Outlook 2011 是否允许这种类型的附件?

【问题讨论】:

  • 我想知道attachment=file:///path/to/file 是否可行。
  • @glennjackman 不幸的是,这仍然不适合我。不过感谢您的建议。

标签: bash email outlook mailto outlook-2011


【解决方案1】:

指定附件不是IETF mailto: URI scheme 的一部分,尽管个别客户可能以某种方式支持它。

我不确定this MSDN document 是否适用于 Outlook 2011 (OSX),但如果适用,那么您尝试使用 可能无法实现。

另外,我假设由于您在命令行中使用open 命令,那么您将对实现此目的的其他命令行/shell-script 方法持开放态度。其中一种方法是将 中的 重定向到here-documentosascript

$ osascript <<EOF
> tell application "Microsoft Outlook"
>     set myMsg to make new outgoing message with properties {subject:"hey", content:"how are you doing"}
>     make new recipient at myMsg with properties {email address:{address:"SomeEmail@example.com"}}
>     make new attachment at myMsg with properties {file:"/Users/myName/Desktop/testFile.rtf"}
>     open myMsg
> end tell
> EOF
$ 

【讨论】:

  • 我认为这是我第一次将 GNU、Apple 专有和 MS 专有元素公然结合在一个答案中;-)
  • 为努力点赞。没有使用 osascript,但感谢您的帮助。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-10-26
  • 2015-06-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-04-10
相关资源
最近更新 更多