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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDONT to CDOSYS 3

Status
Not open for further replies.

A1Pat

IS-IT--Management
Jun 7, 2004
454
US
hi all,
i'm not sure this problem of mine related to this section or not, but I just go ahead and try anyway just incase.

I have a project to upgrade a shopping cart mailing function from CDONT to CDOSYS. I copied and modified to accomodate with the existing code, and this is what I got:

<%
Function CDOSYS(fromName, fromEmail, toEmail, subject, body, contType)
dim mail,conf,flds,I

Set mail = Server.CreateObject("CDO.Message")
Set conf = Server.CreateObject("CDO.Configuration")
Set flds = conf.Fields

'Configure the server
flds(" = pSmtpServer
flds(" = 25
flds(" = 2
flds(" = 60
flds.Update
mail.Configuration = conf

'Message
mail.From = fromName & " <" & fromEmail & ">"
mail.Subject = subject
if contType = 1 then 'Send HTML Email
mail.HTMLBody = body
else
mail.TextBody = body
end if
if isArray(toEmail) then 'Send Multiple Emails
for I = 0 to Ubound(toEmail)
if len(toEmail(I)) > 0 then
mail.To = toEmail(I)
mail.Send
end if
next
else 'Send Single Email
mail.To = toEmail
mail.Send
end if

'Clean up
set mail = nothing
set flds = nothing
set conf = nothing

end Function
%>

However, I got this message:

"The page cannot be displayed", and no particular error is suggested, so I'm stuck.

I tracked the code to where the problem has begun, and knowing for sure it is somewhere between this CDOSYS codes.

Could someone help me to see where the ERROR actually located, and if possible, help me to correct it.

Thank alot!
 
May I add that I believe the problem happens right after the "mail.Send" code. Anything before it is moving as I checked except right after the line "mail.Send" when the error occured.

Hope this help! :)
 
I just found out the ERROR by testing the shoppping cart with Mozilla browser:

CDO.Message.1 error '80040213'

The transport failed to connect to the server.

/new/main/scripts/_INCappEmail_.asp, line 235

the line 235: mail.Send

Any idea why?

Thanks!
 
>[tt]mail.Configuration = conf[/tt]
[tt][red]set[/red] mail.Configuration = conf[/tt]


 
If SendUsing is 2 then i think it tries to use an SMTP server on your network rather than the local virtual server.
 
I was in a similar sitituation. My configuration was comparable:
set cdoConfig=createObject("CDO.configuration")
with cdoConfig.Fields
.Item(cdoSendUsingMethod) = 2
.Item(cdoSMTPServer) = <mail server>
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPAuthenticate) = cdoAnonymous
.Update
end with

Check with the infrastrusture group and make sure that the mail server is set to send anonymous.
Also check the following:
aspfaq.com
support.microsoft.com/default.aspx/kb/323350 where in you can test.
 
Thank you all for your help!

And specially ChrisHirst for your pinpoint question. You are right, I did have to call the webhost people and they provided me the local stmp webhost ip address, which is used for pSmtpServer. Problem solved!!!

Thank you all again!!! keep up the good work!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top