【问题标题】:Outlook Express - sending e-mail from the command lineOutlook Express - 从命令行发送电子邮件
【发布时间】:2010-09-20 04:08:38
【问题描述】:

从命令行使用 Outlook Express 发送电子邮件的最佳方式是什么?它必须是没有用户交互的自动化操作。附件中会有一些 .jpg 文件。 谢谢。

【问题讨论】:

    标签: email command-line outlook


    【解决方案1】:

    Quick'n dirty AutoIt脚本,可以修改 从命令行接受参数:

    ; Send a mail vía outlook "automation"
    
    $sRcpt = "test@test.com"
    $sSubj = "Test subject"
    $sBody = "This is a test"
    $sAttach = "g:\AutoIt\AnHoras.PRG"
    
    If Not WinActivate ("[REGEXPTITLE:.*\- Outlook Express]") Then
        RunWait ("d:\Archivos de programa\Outlook Express\msimn.exe")   ; Set your path to the Outlook .exe
    Endif
    
    Send ("!anm")   ; Archivo->Nuevo->Mensaje (in spanish, sorry, I suppose that in english it will be File->New->Message)
    Send ($sRcpt & "{Tab 3}")
    Send ($sSubj & "{Tab}")
    Send ($sBody)
    
    If $sAttach <> "" Then
        Send ("!i{Enter}" & $sAttach & "{Enter}")      ; Insertar adjunto (Insert->Attachment)
    EndIf
    
    Send ("!a{Down}{Enter}")        ; Archivo->Enviar mensaje (File->Send message)
    

    【讨论】:

      【解决方案2】:

      我认为这个帖子:Send mail from a Windows script 可能会对你有所帮助。

      【讨论】:

        【解决方案3】:

        真的需要使用 Outlook Express 发送电子邮件吗?

        您不能使用第三方命令行电子邮件工具,还是需要它来使用 Outlook Express 的设置并将邮件最终放在“已发送”文件夹中?

        如果您可以使用第三方工具,absoluteTools SendMail CMD 之类的工具可能会完成这项工作。

        【讨论】:

          【解决方案4】:

          也许this post 有帮助。它会预先填充新的电子邮件消息并包含一个文件。

          【讨论】:

            猜你喜欢
            • 2023-03-10
            • 1970-01-01
            • 2010-09-07
            • 2013-07-07
            • 2018-07-24
            • 2015-01-24
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多