当我尝试发送电子邮件时,我试图理解我在命令提示符下遇到的脚本错误。错误是," CDO.Message.1:" SendUsing"配置无效。"。我不明白为什么我在使用vbscript而不是使用完全相同的代码的网页时出现此错误?
下面列出的是我在脚本和网页中使用的代码:
Dim objCDOSYSMail, eMailBodyText, objBP, sErrorMsg, nids, i, n, t, updatedNids, titles
'' -- Create the CDOSYS e-mail server object
Set objCDOSYSMail = CreateObject("CDO.Message")
'' -- Outgoing SMTP Server
objCDOSYSMail.Configuration.Fields.Item("http://schemas.xxx.com/cdo/configuration/SMTPServer") = "xxx"
objCDOSYSMail.Configuration.Fields.Item("http://schemas.xxx.com/cdo/configuration/SMTPServerPort") = 25
objCDOSYSMail.Configuration.Fields.Item("http://schemas.xxx.com/cdo/configuration/SendUsing") = 2
objCDOSYSMail.Configuration.Fields.Item("http://schemas.xxx.com/cdo/configuration/SMTPConnectionTimeout") = 60
'' -- Update the CDOSYS Configuration
objCDOSYSMail.Configuration.Fields.Update
'' -- objCDOSYSMail.ReplyTo = Trim(Request.Form("email"))
objCDOSYSMail.Subject = "Test"
objCDOSYSMail.From = "xxx"
'' -- set the recipient's e-mail address based on the webserver environment
objCDOSYSMail.To = "xxx"
emailBodyText = "test"
Wscript.Echo "Email Body"
Wscript.echo eMailBodyText
objCDOSYSMail.HTMLBody = eMailBodyText
objCDOSYSMail.Send
Wscript.echo "Sending Email..."
我必须根据公司的安全政策删除一些信息。但是,该函数在Web .htm格式下正常工作,但在命令提示符.vbs格式中不起作用。
由于