Outlook Express - 从命令行发送电子邮件
问题描述:
从命令行使用Outlook Express发送电子邮件的最佳方式是什么?它必须是无需用户交互的自动操作。附件中会有一些.jpg文件。 谢谢。Outlook Express - 从命令行发送电子邮件
答
是否真的需要使用Outlook Express发送电子邮件?
难道你不能使用第三方命令行电子邮件工具,或者你需要它来使用Outlook Express的设置和邮件结束在发送文件夹?
如果您可以使用第三方工具,像absoluteTools SendMail CMD这样的东西可能会完成这项工作。
答
Quick'n脏AutoIt脚本,你可以修改它 接受的命令行参数:
; Send a mail vía outlook "automation"
$sRcpt = "[email protected]"
$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)