启动 Outlook,通过 Outlook 的命令行开关撰写带有主题和附件的邮件

发布于 2024-12-11 21:40:51 字数 413 浏览 0 评论 0原文

以下 Outlook 命令适用于 Outlook 2010:

outlook.exe /c ipm.note /m "&subject=abc" /a "c:\attach.txt"

但不适用于 Outlook 2007 和 2003。 奇怪的是以下命令适用于 Outlook 2007 和 2003:

outlook.exe /c ipm.note /m "&subject=abc"
outlook.exe /c ipm.note /a "c:\attach.txt"

How do I use one command line switch to launch Outlook to 撰写邮件Outlook 2010/2007/2003 的主题和附件?

The following Outlook's command works well with Outlook 2010:

outlook.exe /c ipm.note /m "&subject=abc" /a "c:\attach.txt"

But it does not work with Outlook 2007 and 2003. The strange are following commands work well with Outlook 2007 and 2003:

outlook.exe /c ipm.note /m "&subject=abc"
outlook.exe /c ipm.note /a "c:\attach.txt"

How do I use one command line switch to launch Outlook to compose message with both subject and attachment for Outlook 2010/2007/2003?

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

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

发布评论

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

评论(3

骷髅 2024-12-18 21:40:51

到目前为止,我在 Outlook 2007 中发现,为了实现这一点,您必须认识到 /a 意味着 /c IPM.note

所以使用

outlook.exe /a "FileName" /m "addresses&cc=&subject=&body="

Works 就可以了(我花了很长时间才弄清楚这一点,因为网络上的每个人似乎都坚持在执行 /m 时必须使用 /c 但没有考虑到/a 会自动为您执行此操作

另外,我注意到在需要放置空格时使用 %20 并不完全正确,而是使用 %2 。%20 不带0) 就是这样做的,否则你最终会在所有空格后面得到一堆 0,这确实很奇怪。

So far from what I've discovered with Outlook 2007 is that in order to achieve this you have to realize that /a implies /c IPM.note.

So using

outlook.exe /a "FileName" /m "addresses&cc=&subject=&body="

Works just fine (took me forever to figure this out cause everyone on the web appears to insist that you must use /c when doing /m but not taking into account that /a does this for you automatically.

Also, I've noticed that using %20 isn't exactly correct when needing to put spaces, instead %2 (%20 without the 0) is doing the trick there. Otherwise you'll end up with a bunch of 0's after all the spaces, very strange indeed.

还如梦归 2024-12-18 21:40:51

我要在这里添加这个。

每次我获得一台新电脑时,我都必须配置我的任务计划程序以向管理层发送每日电子邮件。每次我搜索时,我都会遇到这个,但这不是我想要的。

我希望每天向一个名为“DailyLog”的群组发送一封电子邮件,主题为“Daily Log”(我并没有说我是原创的)。

我从 Microsoft 的此知识库开始:

如何使用命令行开关创建预寻址Outlook 中的电子邮件

以下是屏幕截图,但您真正需要注意的唯一一个是操作 选项卡:

常规

触发器

Actions

在上图中,“操作”选项卡是所有重要信息所在的位置。

根据您的 Microsoft Outlook 版本,您的路径可能会有所不同。

Edit Action

请注意,程序/脚本部分需要用引号引起来。 添加参数(可选)用引号括起来!

这是我在参数文本框中使用的内容:

/c ipm.note /m DailyLogGroup;&subject=Daily%20Log

/c 开关创建消息 (ipm.note),/m 开关放置TO 字段中的 DailyLogGroup 组,主题中包含文本 Daily Log%20 是空格) 。

条件

设置

I'm going to add this here.

Every time I get a new PC, I have to configure my Task Scheduler to launch my daily email to management. Every time I search, I come across this one, but it isn't quite what I want.

I want a daily email to be sent to a group entitled "DailyLog" with the Subject="Daily Log" (I didn't say I was being original).

I start with this KB from Microsoft:

How to use command line switches to create a pre-addressed e-mail message in Outlook

Here are the screenshots for that, but the only one you really need to pay attention to is the Action tab:

General

Triggers

Actions

In the image above, the Actions tab is where all of the important information goes.

Depending on your version of Microsoft Outlook, your path could look different.

Edit Action

Notice the Program/script section needs to be in quotes. The Add arguments (optional) is NOT in quotes!

Here is what I use in the arguments text box:

/c ipm.note /m DailyLogGroup;&subject=Daily%20Log

The /c switch creates the message (ipm.note), and the /m switch places the group DailyLogGroup in the TO field with the text Daily Log in the subject (%20 is a blank space).

Conditions

Settings

短叹 2024-12-18 21:40:51
Outlook > Tools > Forms > DesignForm > Message > Open

    To = "[email protected]"

ViewCode

    Function Item_Open()
    If Item.Size = 0 Then : Item.Send : End If
    End Function

File > Close > Publish > PublishFormAs

    DisplayName = "test_130713_0856"

Publish > [CLOSE] > Yes

send_email.bat
--------------
"C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE" ^
    /c "IPM.Note.test_130713_0856" ^
    /m "[email protected]&subject=hello world&body=blah blah blah" ^
    /a h:\test.txt
Outlook > Tools > Forms > DesignForm > Message > Open

    To = "[email protected]"

ViewCode

    Function Item_Open()
    If Item.Size = 0 Then : Item.Send : End If
    End Function

File > Close > Publish > PublishFormAs

    DisplayName = "test_130713_0856"

Publish > [CLOSE] > Yes

send_email.bat
--------------
"C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE" ^
    /c "IPM.Note.test_130713_0856" ^
    /m "[email protected]&subject=hello world&body=blah blah blah" ^
    /a h:\test.txt
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文