我使用ASP classic通过msmtp发送电子邮件。但是,以下都不起作用
set objShell = CreateObject("WScript.Shell")
objShell.Run "%COMSPEC% /C echo ""hello world"" | c:\path\to\msmtp.exe recipient@mail.com" , 0, true
objShell.Run "%COMSPEC% /C ""echo hello world"" | ""c:\path\to\msmtp.exe"" ""recipient@mail.com""" , 0, true
objShell.Run "%COMSPEC% /C ""echo hello world | c:\path\to\msmtp.exe recipient@mail.com""" , 0, true
objShell.Run "%COMSPEC% /C echo hello world | c:\path\to\msmtp.exe recipient@mail.com" , 0, true
答案 0 :(得分:1)
通过授予IUSR访问msmtp使用的配置文件的权限解决了问题。然后语法工作正常。
objShell.Run "%COMSPEC% /C echo ""hello world"" | c:\path\to\msmtp.exe recipient@mail.com" , 0, true