CDO不再在网络解决方案上使用Windows Server

时间:2014-11-08 21:02:33

标签: email asp-classic cdo.message

我在网络解决方案上使用CDO的服务器端脚本现在因“500服务器错误”而失败他们是否更改了他们的Windows服务器?

此代码适用于由Network解决方案托管的其他一些域。我尝试将localhost和服务器端口更改为25,但没有运气。

<%@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 ********************

%>

1 个答案:

答案 0 :(得分:0)

问题解决了。网络解决方案Windows Server在使用身份验证时仅适用于CDO: 必须定义cdoSMTPAuthenticate,cdoSendUsername,cdoSendPassword。