Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDO for Windows 2000 No Longer Working

Status
Not open for further replies.

snakehips2000

Programmer
Nov 10, 2003
95
GB
I have a basic online email submission form on my site which has been working without problem for over a year. Now, it suddenly doesn't work. In an attempt to locate the problem, I've tried including a Response.Write line in my code to ensure the form values for the To, From, Subject and TextBody values are being accurately passed from my form and they are. The page returns the Response.Write values but fails at the ".Send" stage with "error '80040211'".

I'm at a loss as to what's changed? Have Microsoft changed the CD Configuration URLS which might now be making my code useless? Any help appreciated.

Here's the ASP code snippet:

<%
Const cdoSendUsingPickup = 1
Const cdoSendUsingPort = 2 'Must use this to use Delivery Notification
Const cdoAnonymous = 0
Const cdoBasic = 1 ' clear text
Const cdoNTLM = 2 'NTLM
'Delivery Status Notifications
Const cdoDSNDefault = 0 'None
Const cdoDSNNever = 1 'None
Const cdoDSNFailure = 2 'Failure
Const cdoDSNSuccess = 4 'Success
Const cdoDSNDelay = 8 'Delay
Const cdoDSNSuccessFailOrDelay = 14 'Success, failure or delay

Set objMessage = Server.CreateObject("CDO.Message")
set objConf = CreateObject("CDO.Configuration")

Set objFlds = objConf.Fields

With objFlds
.Item(" = cdoSendUsingPort
.Item(" = "[My SMTP Server]"
.Item(" = cdoBasic
.Item(" = "[my user name]"
.Item(" = "[my webmail password]"
.Update
End With
dim strEmail, strMsg, mainMsg

strEmail=Request.Form("SenderEmail")
strMsg=Request.Form("Msg")

With objMessage
Set .Configuration = objConf
.To = "[Recipient's email address]"
.From = strEmail
.Subject = "Any Subject"
.TextBody = strMsg
mainMsg=objMessage.To & " " & objMessage.From & " " & objMessage.Subject & " " & objMessage.TextBody
Response.write(mainMsg)
.Send
End With
Set objMessage = Nothing
Set objFields=Nothing
Set objConf=Nothing
%>
 
Chris,

Thanks for the suggestion. I'll look into it with the ISP. However, assuming I'm looking at the relevant piece of code I submitted, what's the significance of mentioning port 25 when my code says

Const cdoSendUsingPort = 2

Thanks
Brian
 
No that is just a flag to determine the sending mechanism. The options are:

cdoSendUsingPickup = 1
cdoSendUsingPort = 2

For the Pickup, it drops the message into a folder on the system... i think it is named inetpub\mailroot\Queue

For Port it puts the message using SMTP. The default TCP/IP port for SMTP is port 25.
 
Another thing to check with your provider is that they haven't made any changes to the SMTP server requirements. I have gone through this a couple times, where they suddenly started requiring one of the other of the fields to be from/to a user on a domain they were hosting and all other emails were directed to /dev/null. If your not getting an error message, trying sending an email with your own address in the to, then try a second one in the from and see if either go through. You may also want to ensure your login information hasn't changed.

Best MS KB Ever:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top