简体   繁体   中英

CDO no longer working on Windows Server at network solutions

I am using a server side script using CDO on Network solution that is now failing with a '500 server error' Have they changed their Windows servers?

This code works fine on some other domains hosted by Network solutions. I tried changing to localhost and the server port to 25 with no luck.

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

%>

Problem solved. Network solutions Windows Server will only work with CDO when employing Authentication: cdoSMTPAuthenticate, cdoSendUsername, cdoSendPassword must be defined.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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