简体   繁体   English

ASP经典MSMTP发送电子邮件

[英]ASP classic msmtp sending email

I am using ASP classic to send email by using msmtp. 我正在使用ASP Classic通过msmtp发送电子邮件。 However, none of the following works 但是,以下任何一项均无效

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

Problem solved by giving permission to IUSR to access the configuration file used by msmtp. 通过授予IUSR访问msmtp使用的配置文件的权限来解决问题。 Then the syntax works fine. 然后语法可以正常工作。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM