Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CDO for Windows 2000, XP

1 view
Skip to first unread message

Chris

unread,
Feb 14, 2002, 1:23:35 PM2/14/02
to
I am using CDO for Windows 2000 to send messages from ASP
via SMTP. Under Windows 2000 this works fine but under
XP, I get always get the following error:

Error Type:
(0x8004020E)
Cannot modify or delete an object that was added using
the COM+ Admin SDK
/Include/Server/email.inc, line 43

Line 43 executes the Send method of the CDO.Message
object. I'm running XP Professional with VS6 SP5
installed. I am unable to find documentation on the
above error code anywhere in the knowledge base. I'm not
even sure what it refers to exactly, as I have no
knowledge of such an SDK even being installed on my
system.

Jason Johnston [MS]

unread,
Feb 14, 2002, 2:16:47 PM2/14/02
to
Chris,

That's a new one on me! Have you tried the sample from:
Q286431 HOWTO: Send HTML Mail with CDO for Win 2000 and Remote SMTP Serv
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q286431

Can you post your code?

Jason Johnston
Microsoft Developer Support - Messaging

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.

Chris Chaffee

unread,
Feb 14, 2002, 4:37:46 PM2/14/02
to
Attached is the code. It was originally written
following the example you mentioned, but has been
modified a bit for flexibility. I'm going to take a look
at the sample again and see if it runs on its own, but
I'm fairly confident that this code is almost identical
to what's in the sample.

Thanks,
Chris

>.
>

email.inc

Sam Low

unread,
Feb 15, 2002, 4:27:54 AM2/15/02
to
I have the following code and it works fine in a .VBS
 
sub SendMail(Subject,Message,ToWhom,FromWhom)
 dim oEmail
 
 set oEMail = CreateObject("CDO.Message")
 oEMail.To = ToWhom
 oEMail.From = FromWhom
 oEMail.Subject = Subject
 oEMail.TextBody = Message
 oEMail.Send
 set objEMail = nothing
end sub
 
SendMail "Test","Hi!","saml...@hotmail.com","saml...@hotmail.com"
 
However, the same code in a .ASP on the very same machine (with server.CreateObject of course) gives me the following error:
 
CDO.Message.1 error '80040220'

The "SendUsing" configuration value is invalid.

/routines.asp, line 21

 
Line 21 is objEmail.Send.
 
On another IIS server (which I have no control and don't know the settings), however the same code works fine.
 
Anyone with any clues on what is causing the error?
 
Thanks.
 
Sam
 

Sam Low

unread,
Feb 15, 2002, 4:46:31 AM2/15/02
to
Maybe I can give more clues:
 
1.  I just tried this code segment in VB without modification and it works fine.  The funny thing is that I didn't even have to add a reference to Microsoft CDO for Exchange 2000 Library (CDOEX.DLL).  CDOSYS.DLL is not a choice in my VB reference list.
 
2.  I am running Windows XP Professional, and I have Outlook XP with Exchange.  My default simple MAPI client is however Outlook Express.
 
Thanks
 
Sam
 
PS: I am trying to avoid CDO.Configuration because it sure looks complicated.  I just want a quick way to send simple mail.
 

Siegfried Weber [MVP]

unread,
Feb 15, 2002, 5:04:35 PM2/15/02
to
"Sam Low" <saml...@hotmail.com> wrote in message...

>
>1. I just tried this code segment in VB without modification and it works
fine. The funny thing is that I didn't even have to add a reference to
>Microsoft CDO for Exchange 2000 Library (CDOEX.DLL). CDOSYS.DLL is not a
choice in my VB reference list.

After installing Office XP the CDO for Exchange 2000 library (CDOEX.DLL)
superseds CDOSYS, so you don't neet to worry about that.

>2. I am running Windows XP Professional, and I have Outlook XP with
Exchange. My default simple MAPI client is however Outlook Express.

> PS: I am trying to avoid CDO.Configuration because it sure looks
complicated. I just want a quick way to send simple mail.

Well, I'm afraid you can't. CDOSYS/CDOEX tries to use the SMTP messaging
configuration of the current logged on user. Because you use Outlook Express
it uses the same Outlook Express SMTP settings and work without any issue.
But your ASP app runs with an Anonymous account (I assume) which doesn't
have any Outlook Express SMTP config and I doubt you can over come this
because the ASP app running with th Anonymous account will not load the
appropriate part of the registry.

My bet is you'd go with a CDO config object. It is quite easy as you can
see:

<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library" -->

Set objConfiguration = CreateObject("CDO.Configuration")
Set objFields = objConfiguration.Fields
With objFields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPServer) = "YourMailServer.YourDomain.Com"
.Update
End With
Set objMessage = CreateObject("CDO.Message")
With objMessage
Set .Configuration = objConfiguration
.From = "YourOri...@YourDomain.Com"
.To = "TheRec...@TheDomain.Com"
.Subject = "YourSubject"
'.TextBody = "YourTextBody"
.Send
End With

(Watch the line breaks!)
--
<Siegfried />

Microsoft Most Valuable Professional (MVP) - Exchange Server
Co-author of "Professional CDO Programming", Wrox Press 1999

CDOLive - The Premier Resource for Microsoft Messaging and Collaboration
Application Technology
http://www.cdolive.com

Please reply to the newsgroups so that others can benefit from the
discussion.
Questions by e-mail are discarded without further notice.

0 new messages