Email CDO不再在网络解决方案的Windows Server上工作
我正在使用一个服务器端脚本,该脚本使用网络上的CDO解决方案,该解决方案现在因“500服务器错误”而失败。他们是否更改了Windows服务器 此代码在网络解决方案托管的其他一些域上运行良好。我尝试改为localhost,服务器端口改为25,但没有成功Email CDO不再在网络解决方案的Windows Server上工作,email,asp-classic,cdo.message,Email,Asp Classic,Cdo.message,我正在使用一个服务器端脚本,该脚本使用网络上的CDO解决方案,该解决方案现在因“500服务器错误”而失败。他们是否更改了Windows服务器 此代码在网络解决方案托管的其他一些域上运行良好。我尝试改为localhost,服务器端口改为25,但没有成功 <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Dim cdoConfig, cdoMessage, sch, nProfileID, sFName, sLName, sEmail,
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Dim cdoConfig, cdoMessage, sch, nProfileID, sFName, sLName, sEmail, sBCC, sFromEmail, sMessage, Optin
nProfileID = Request.Form("profileID")
sFName = Request.Form("fname")
sLName = Request.Form("lname")
sFromEmail = Request.Form("email")
sMessage = Request.Form("message")
Optin = Request.Form("optin")
'sAction = "email_form_work.asp?profileID=" & nProfileID
sEmail = "m.hill@secretagency.com" 'generic email account *** change to info@bglawde.com
sBCC = "hillcreative@comcast.net"
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
'Set CDO Port
.Item(sch & "sendusing") = 1
'Set mailserver name either IP address, mail.yoursite.com or localhost
.Item(sch & "smtpserver") = "smtp.secretagency.com"
'Set SMTP port which is 25 by default
.Item(sch & "smtpserverport") = 2525
'Set number of seconds before timeout
.Item(sch & "smtpconnectiontimeout") = 60
.update
End With
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = sFromEmail
.To = sEmail
.CC = ""
'use this to send a blind copy
.BCC = sBCC
.Subject = ""
'Send the email in text format *comment out HTML
.TextBody = sFName & " " & sLName & " has sent you the following message:" & vbCRLF & vbCRLF & sMessage & vbCRLF
.Send
End With
set cdoMessage = nothing
set cdoConfig = nothing
'************ Mail ends here ********************
%>
问题解决了。网络解决方案Windows Server仅在采用身份验证时与CDO一起工作:
必须定义cdoSMTPAuthenticate、cdoSendUsername、cdoSendPassword。我看不到任何错误检测或处理!除了CDO已经过时之外,问题很可能是配置或权限。检查服务器的日志;在代码中加入一些错误处理,并从中进行故障排除。仍然没有解释为什么它不再适用于网络解决方案。我理解您对最佳实践的评论,但……F**最佳实践。如果没有错误消息,您就是在黑暗中无知地射击。也许是一些建设性的帮助。感谢您的时间。在网络解决方案上不使用CDO进行身份验证,CDO将失败!我不知道如何让一个被认可的答案变得更简单。。。天哪。。。