ASP经典msmtp发送电子邮件

时间:2014-03-22 08:57:50

标签: asp-classic

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

1 个答案:

答案 0 :(得分:1)

通过授予IUSR访问msmtp使用的配置文件的权限解决了问题。然后语法工作正常。

objShell.Run "%COMSPEC% /C echo ""hello world"" | c:\path\to\msmtp.exe recipient@mail.com" , 0, true