从命令行发送电子邮件

时间:2014-12-08 22:04:17

标签: excel-vba command-line thunderbird vba excel

我使用excel VBA在Thunderbird中使用命令行参数创建电子邮件,可在此处找到: http://kb.mozillazine.org/Command_line_arguments_%28Thunderbird%29

撰写邮件的工作正常,但我怎样才能真正自动发送? 我没有看到这样的命令。

或者,Thunderbird中是否有一个按钮可以立即发送所有撰写的电子邮件?找不到那个人。

非常感谢!

如果以某种方式相关,VBA代码看起来像这样:

Option Explicit

Sub thunderbird()

Dim strTh As String
Dim strCommand As String

strTh = "C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe "

strCommand = strCommand & " -compose " & "to=" & Chr(34) & "foo@bar.de" & Chr(34)
strCommand = strCommand & ",preselectid=id2"
strCommand = strCommand & ",subject=" & Chr(34) & "wow so email" & Chr(34)
strCommand = strCommand & ",body=" & Chr(34) & "anything" & Chr(10) & "more" & Chr(34)

Call Shell(strTh & strCommand, vbNormalFocus)

End Sub

1 个答案:

答案 0 :(得分:0)

不幸的是,这是不可能的。但是,https://support.mozilla.org/questions/1144493列出了替代方案,以防它们对您有用。

从UI的“文件”->“发送未发送的消息”应该可以工作(您可能需要激活菜单栏)来发送所有已编写的消息。