【问题标题】:Send email from command line从命令行发送电子邮件
【发布时间】:2023-03-10 06:40:01
【问题描述】:

我使用 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

【问题讨论】:

  • 注意:您可以使用行继续标记_ 来简化字符串连接。
  • 谢谢。我在其他地方找到了这个 sn-p,只做了一点修改。最终将遵循您的建议。

标签: excel vba command-line thunderbird


【解决方案1】:

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

从 UI 中,文件 -> 发送未发送消息应该可以发送所有已撰写的消息(您可能需要激活菜单栏)。

【讨论】:

    猜你喜欢
    • 2010-09-20
    • 2010-09-07
    • 2015-01-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-13
    • 1970-01-01
    相关资源
    最近更新 更多