Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 11th, 2007, 12:47 PM
Registered User
 
Join Date: Dec 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems with CDOSYS and servers

Hello,
I have a problem and cannot figure out the solution in any way.
I use this code to send emails and it works:

Code:
Const cdoSendUsingPickup = 1
Const cdoSendUsingPort = 2
Const cdoSendUsingExchange = 3

Set Message = CreateObject("CDO.Message")

With Message.Configuration.Fields

    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.posta.it"  


    .Update
  End With

  With Message
 .from=ecc
 ecc

 end with
the server is win server 2003 and the cdosys.dll version number is 6.5.6757

This code doesn't work with another server (xp pro and cdosys.dll version number 6.2.4.0).
The error I get is:
CDO.Configuration.1
Interface not registered

Please, does anyone know what the problem could be? I really don't know what to do.


 
Old December 11th, 2007, 06:40 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I have never seen this error and have never had a problem with using CDOSYS. Your code is skinny, i there any reason you have removed some of the reccomended lines? In my experience the reccomended code is:

Const cdoSendUsingPort = 2
Dim iMsg,iConf,Flds,strHTML,strSmartHost
'place your SMTP IP below
StrSmartHost = "xxx.xxx.xx.xx"
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

'set the CDOSYS configuration fields to use port 25 on the SMTP server
With Flds
   .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
   .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
   .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
   .Update
End With

'apply the settings to the message
With iMsg
   Set .Configuration = iConf
   .To = "someAddres.com"
   .From = "someotheraddress.com"
   .Subject = "CDOSYS Test"
   .HTMLBody = "Sent using CDOSYS..."
   .Send
End With

' cleanup of variables
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

Wind is your friend
Matt
 
Old December 11th, 2007, 06:43 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Your errror intrigued me. After having a look around, I found this post:

http://www.tek-tips.com/viewthread.cfm?qid=1430003b

Is that your post? I suspect so...

Wind is your friend
Matt
 
Old December 12th, 2007, 05:21 AM
Registered User
 
Join Date: Dec 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for replying.
Matt, clicking your link gives me "page not found" but I wrote a post on tek-tips for the same problem. Then googling around I found the locked topics of p2p and there were discussions on cdo so I decided to submit the problem here as well.

I tried skinny and not skinny versions.

I also tried with all the specifications:
Code:
Set cdoConfig = CreateObject("CDO.Configuration")
Set Message = CreateObject("CDO.Message")

with cdoConfig.fields

.Item("http://schemas.microsoft.com/cdo/configuration/sendemailaddress") =
"[email protected]"

.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
 cdoSendUsingPort
     .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
     .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
 = 25

    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
 "mail.mail.it"

 .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")
 = cdoBasic
     .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") =
 False


    .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") =
 "[email protected]"
   .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
 "password"

    .Update
   End With
 Set Message.Configuration = cdoConfig
 
With Message
etc etc..
In one version I remember cleaning up the variables although in later versions I omitted it (I don't know why :-) this problem is driving me insane). I can see you used connectiontimeout and the fact that you wrote the smtp name using numbers and not letters. Maybe I should try that. But I suspect that there's something with xp pro. I mean, the code I posted in the first post works with win server 2003, could it be a difference in the libraries? or maybe xp need different configurations?

 
Old December 12th, 2007, 05:44 AM
Registered User
 
Join Date: Dec 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

nada de nada, I told them to write the smtp using the ip but nothing changed. They told me that the two servers are in different domains, can it be useful in some ways?

 
Old December 13th, 2007, 06:59 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;I told them to write the smtp using the ip but nothing changed.
Who is them? IMO You should use the reccomended CDOSYS code from the MS web site

;;;They told me that the two servers are in different domains, can it be useful in some ways?
you lost me here. You are trying to send mail from an XP box yeah?

I just tried the following code on an XP box. It works as expected. Run this code on your XP box sending to one of your 'valid internal addresses'. You may need to authenticate mail to external addresses. Getting mail sent internaly will tell you the SMTP end of things is working

Dim iMsg,iConf,Flds,strHTML,strSmartHost
Const cdoSendUsingPort = 2
StrSmartHost = mailIP
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
  .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
  .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
  .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
  .Update
End With
With iMsg
  Set .Configuration = iConf
  .To = mailAddress
  .From = "someAddress.com.au"
  .Subject = "SomeSubject"
  .HTMLBody = "Some body text"
  .Send
End With

;;;Matt, clicking your link gives me "page not found"
The person who helped you here mentions some valid and useful things, try this link:
http://www.tek-tips.com/viewthread.cfm?qid=1430003


Wind is your friend
Matt
 
Old December 14th, 2007, 06:32 AM
Registered User
 
Join Date: Dec 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Matt, thanks for replying.
I say "they" because I haven't got direct access to these servers. I made some features for their website and at first things worked, then they decided to put all the files in another server but this mail thing doesn't work anymore.
I sent them your code exactly as it is (changing smtp server and email address but the problem is still there.
I asked more questions:
they told me that win 2003 and xp are in two different domains but they use the same smtp server. And from xp they can send mails with outlook.


 
Old December 15th, 2007, 07:17 AM
Registered User
 
Join Date: Dec 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I came up with a strange idea. Could it be that they have a firewall that prevents the server to get connected with
http://schemas.microsoft.com/cdo/con...tion/sendusing and similar?

 
Old December 16th, 2007, 07:55 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;but the problem is still there
Is the error the same as your first post? Difficult to help with sucha a hairy description. think about someone else helping you who has not read all the posts in this topic. Whats the exact error and where does it occur in the code you sent them?

;;;they told me that win 2003 and xp are in two different domains but they use the same smtp server.
Sounds like a smoke screen to me. Who cares where the boxes are and weather they use the same SMTP service. As a developer its your job to write bug free code. It is the poeple with admin access's job to ensure the SMTP service is working. Ask them to use command line and send a nessage to establish if the service is working. Any network admin can do this is 10 seconds - This all sounds awfully hard!!

;;;Could it be that they have a firewall that prevents the
Once again you are not a network admin, nor have the access. Sounds like you are developing a site on a box which is run by cowboys. I suggest you document your discussions with them.

Remember posting exact errors will give you answers quicker. Dont let them sauy it doesnt work, turn off friendly errors and post the unfriendly error here.


FYI CDOSYS is the reccomended method for boxes >= 2003 server however here are other options:

Use CDO:
<%
Set cdoConfig=server.CreateObject("CDO.Configuration")
cdoConfig.Fields.Item(theSchema & "smtpserver")="xxx.xx.xx"
set cdoMessage=server.CreateObject("CDO.Message")
cdoMessage.Configuration=cdoConfig
cdoMessage.From="[email protected]"
cdoMessage.To="[email protected] m"
cdoMessage.Subject="Test CDO"
cdoMessage.TextBody="Using CDO"
cdoMessage.Send
Set cdoMessage=Nothing
Set cdoConfig=Nothing
Response.write("CDO - Mail was Sent")

%>

use CDONTS:
<%
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "[email protected]"
objMail.Subject = "CDONTS Test"
objMail.To = "[email protected]"
objMail.Body = "sent using CDONTS"
objMail.Send
Response.write("CDONTS - Mail was Sent")
set objMail = nothing
%>

Where authentication is required:
<%
Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
     .Item(cdoSendUsingMethod) = cdoSendUsingPort
     .Item(cdoSMTPServer) = "1xx.xx.xx"
     .Item(cdoSMTPAuthenticate) = 1
     .Item(cdoSendUsername) = "aValiduserName"
     .Item(cdoSendPassword) = "aValidPassword"
     .Update
End With

Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
     Set .Configuration = cdoConfig
     .From = "[email protected]"
     .To = "[email protected]"
     .Subject = "Test external CDO"
     .TextBody = "Testing external authenticated mail sending from frsyws02"
     .Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>

You have CDOSYS in a post above. If one of these methods dont wotk for you you need to give these cowboy administators a shake up

Wind is your friend
Matt
 
Old December 20th, 2007, 07:37 AM
Registered User
 
Join Date: Dec 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Matt,
no particular updates for this situation. They did a telnet to the smtp server and the communication succeeded on port 25. Then they wrote their own aspx test page and they get the error :
[COMException (0x80040154): Interface non registered
]

there's a difference in the exception, now I'm trying to figure out what's the meaning of this.

I also found out that the smtp server is Exchange 2003.

So summarizing:

The code works when:

Domain A
smtp: exch 2003
win 2003
xp with iis and using exchange 2003

The code doesn't work when:

Domain A
smtp exch 2003

Domain B
xp pro





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem using CDOSYS shankhan Classic ASP Components 1 January 9th, 2009 11:22 AM
CDOSYS Error cancer10 Classic ASP Components 1 May 21st, 2007 10:53 PM
Problems with CDO.Message (CDOSYS) roynaveen Classic ASP Professional 1 March 14th, 2007 07:56 AM
CDOSYS Bob Bedell Pro VB 6 1 February 14th, 2006 10:16 AM
How do you use CDOSYS mail SoC Classic ASP Basics 5 April 20th, 2005 10:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.