Unable to create CDO.Message for Workflow application
Exchange Server Forum Index Exchange Server
Discussion forums for Microsoft Exchange Server users.
Microsoft Outlook
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web ExchangeServerHelp.com
Unable to create CDO.Message for Workflow application

 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development
Author Message
talk_positive
Guest





Posted: Thu Aug 25, 2005 8:59 am    Post subject: Unable to create CDO.Message for Workflow application Reply with quote

Hi....

I have been trying desperately to send mail using CDO objects. My platform
is Windows 2000 Server and am having Exchange server 2003 installed. I

am actully desigining workflow using workflow designer...

The code is as follows..........

***************************************************
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
cdoConfig.Fields.Item(sch & "sendusing") = 2
cdoConfig.Fields.Item(sch & "smtpserver") = "msexchange.com"
cdoConfig.fields.update

Set cdoMessage = CreateObject("CDO.Message")
Set cdoMessage.Configuration = cdoConfig
cdoMessage.From = "from@me.com"
cdoMessage.To = "to@me.com"
cdoMessage.Subject = "Sample CDONTS NewMail"
cdoMessage.TextBody = "This is a test for CDONTS message"
cdoMessage.Send
Set cdoMessage = Nothing
Set cdoConfig = Nothing
***************************************************

Now...if i run this code i get error message...." ActiveX component can't
create object 'CDO.Configuration' "
If i modify the 2nd line to " Set cdoConfig =
Server.CreateObject("CDO.Configuration") ", as someone suggested...then i
get the error..." Server

object expected ".

I searched my machine for " *CDO*.dll " files and found CDOSYS.dll, CDO.dll
& CDOEX.dll.
I also registered them using the "regsrv32" command as was mentioned in one
MSDN article.
Could this be a problem because of the multiple CDO files?

I have made sure that Everone has atleast Read permission for CDO files.

If i remove the Configuration part of the code then i get the error "
ActiveX component can't create object 'CDO.Message' ".


I have made sure that the IIS service is running....( if it happens to have
any relation with CDO )

Can u help me locate and correct the problem? Also, can u suggest another
way to send mail if CDO does not work. Plz exclude Jmail.

If u need any clearifications u can either post a message or mail me at
mailanoop@gmail.com.

Thanks in advance....

- Anoop

Back to top
Mad Dog
Guest





Posted: Thu Aug 25, 2005 8:59 am    Post subject: Re: Unable to create CDO.Message for Workflow application Reply with quote

Anoop,

This is the code I use to send a message from the Workflow Sink

It doesnt have all the configuration code you use and works fine
providing the to and from are valid

**
Set oMsg = CreateObject("CDO.Message")

oMsg.To = strTo

oMsg.From = WorkflowSession.Sender
oMsg.Subject = strSubject

oMsg.HTMLBody = "<html><body>" & strBody & "</body></html>"

oMsg.Send
**

(I use HTMLBody because it is easier to include a link.)

If the above code still gives you the same error then check you have
ADO (MDAC) installed. Sounds bizarre but CDO relies on ADO being
present. I once got your error when trying to send a message from a
server that did not have ADO.
Back to top
talk_positive
Guest





Posted: Thu Aug 25, 2005 5:00 pm    Post subject: Re: Unable to create CDO.Message for Workflow application Reply with quote

Hi....

Actully, I have no idea about ADO....I tried to search for ADO on my drive
and found a ADO directory. How do i make sure thats its present and
registered for use ? Also, does it not ship with Win 2k server ? I have
installed Exchange 2003 and Office XP. Could these contain ADO files. If
not...plz let me know from where i can download it.

Thanks for your interest....

Regards,
Anoop




"Mad Dog" wrote:

Quote:
Anoop,

This is the code I use to send a message from the Workflow Sink

It doesnt have all the configuration code you use and works fine
providing the to and from are valid

**
Set oMsg = CreateObject("CDO.Message")

oMsg.To = strTo

oMsg.From = WorkflowSession.Sender
oMsg.Subject = strSubject

oMsg.HTMLBody = "<html><body>" & strBody & "</body></html>"

oMsg.Send
**

(I use HTMLBody because it is easier to include a link.)

If the above code still gives you the same error then check you have
ADO (MDAC) installed. Sounds bizarre but CDO relies on ADO being
present. I once got your error when trying to send a message from a
server that did not have ADO.



Back to top
Mad Dog
Guest





Posted: Fri Aug 26, 2005 8:59 am    Post subject: Re: Unable to create CDO.Message for Workflow application Reply with quote

You will not nescessarily have it installed as a part of Win2k server.
I believe it ships with office but it depends on install options. Look
for a file on you PC called MDAC*.Exe. If not on PC try your install
discs for office or win2k.

Running this file installs ado.

If you cant find the file try Microsoft sites for a download.

I am a VB developper so have always got ADO as part of whichever Visual
Studio I am on. If you have access to any Visual Studio disks these
will have it.

This is going outside my area of expertease but there is a fair bit on
the web about it. Try searching CDO ADO MDAC


Hope this helps.



talk_positive wrote:
Quote:
Hi....

Actully, I have no idea about ADO....I tried to search for ADO on my drive
and found a ADO directory. How do i make sure thats its present and
registered for use ? Also, does it not ship with Win 2k server ? I have
installed Exchange 2003 and Office XP. Could these contain ADO files. If
not...plz let me know from where i can download it.

Thanks for your interest....

Regards,
Anoop




"Mad Dog" wrote:

Anoop,

This is the code I use to send a message from the Workflow Sink

It doesnt have all the configuration code you use and works fine
providing the to and from are valid

**
Set oMsg = CreateObject("CDO.Message")

oMsg.To = strTo

oMsg.From = WorkflowSession.Sender
oMsg.Subject = strSubject

oMsg.HTMLBody = "<html><body>" & strBody & "</body></html>"

oMsg.Send
**

(I use HTMLBody because it is easier to include a link.)

If the above code still gives you the same error then check you have
ADO (MDAC) installed. Sounds bizarre but CDO relies on ADO being
present. I once got your error when trying to send a message from a
server that did not have ADO.

Back to top
talk_positive
Guest





Posted: Sat Aug 27, 2005 4:58 pm    Post subject: Re: Unable to create CDO.Message for Workflow application Reply with quote

Hi....

I read some articles at microsoft.com and found that MDAC is installed by
default in Win 2000 and further. It's not available in Win NT. So...that way,
i think, ADO is not the problem.

Anythink else to try....Also..can u suggest some third party s/w that can
help me achive this...Not Jmail...coze i think it needs JVM installed.

Thanks and Regards,
- Anoop
Back to top
Tom Rizzo [MSFT]
Guest





Posted: Wed Aug 31, 2005 8:59 am    Post subject: Re: Unable to create CDO.Message for Workflow application Reply with quote

Is your worklow running under an account that is in the Privileged Workflow
Authors role? You can't use CreateObject if they are not.

Tom

--
Looking for a good book on programming Exchange, Outlook, ADSI and
SharePoint? Check out http://www.microsoft.com/MSPress/books/5517.asp


"talk_positive" <talkpositive@discussions.microsoft.com> wrote in message
news:C4AE8314-232F-4741-8042-0C160F6495AB@microsoft.com...
Quote:
Hi....

I have been trying desperately to send mail using CDO objects. My platform
is Windows 2000 Server and am having Exchange server 2003 installed. I

am actully desigining workflow using workflow designer...

The code is as follows..........

***************************************************
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
cdoConfig.Fields.Item(sch & "sendusing") = 2
cdoConfig.Fields.Item(sch & "smtpserver") = "msexchange.com"
cdoConfig.fields.update

Set cdoMessage = CreateObject("CDO.Message")
Set cdoMessage.Configuration = cdoConfig
cdoMessage.From = "from@me.com"
cdoMessage.To = "to@me.com"
cdoMessage.Subject = "Sample CDONTS NewMail"
cdoMessage.TextBody = "This is a test for CDONTS message"
cdoMessage.Send
Set cdoMessage = Nothing
Set cdoConfig = Nothing
***************************************************

Now...if i run this code i get error message...." ActiveX component can't
create object 'CDO.Configuration' "
If i modify the 2nd line to " Set cdoConfig =
Server.CreateObject("CDO.Configuration") ", as someone suggested...then i
get the error..." Server

object expected ".

I searched my machine for " *CDO*.dll " files and found CDOSYS.dll,
CDO.dll
& CDOEX.dll.
I also registered them using the "regsrv32" command as was mentioned in
one
MSDN article.
Could this be a problem because of the multiple CDO files?

I have made sure that Everone has atleast Read permission for CDO files.

If i remove the Configuration part of the code then i get the error "
ActiveX component can't create object 'CDO.Message' ".


I have made sure that the IIS service is running....( if it happens to
have
any relation with CDO )

Can u help me locate and correct the problem? Also, can u suggest another
way to send mail if CDO does not work. Plz exclude Jmail.

If u need any clearifications u can either post a message or mail me at
mailanoop@gmail.com.

Thanks in advance....

- Anoop
Back to top
Alexander V. Alexeev
Guest





Posted: Wed Aug 31, 2005 8:59 am    Post subject: Re: Unable to create CDO.Message for Workflow application Reply with quote

Hi there,

Replying to this thread coz I am experiencing a problem of the same kind.
Namely, this is what I get in the event log of the mahcine with the Exchange
Server 2000 SP3.

---
<file://./backofficestorage/yks.ru/Public Folders/PurchaseOrders/4.EML>: Old
state '', new state 'Submit to Manager', caption 'Create and Sumbit', event
type 'OnCreate', ActionTable row ID '1'. State transition error: Error in
action: Run time error at line 104. Source: Microsoft VBScript runtime error
Error: 800a01ad. Description: ActiveX component can't create object:
'CDO.Message'
---

That is when I try to use the example Walkthrouh provided with the Office XP
Developer kit, which has the Workflow Designer. I followed all the
instructions step by step, exactly as stated in the Walkthrough - set
everything up. The error occurs when I try to Post anything to the folder:
Unknown error - comes up. Then I see the above entry in the Event Log.

The account permissions are ok, I doublechecked. Plugged my user account
into all admin roles and Workflow COM object possible - yet still no result.
The account under which the Workflow Event Sink runs also is a member of the
both roles and Exchange Domain Servers.

Anything else I should look at to remedy this situation?

Thanks!
Alex A
P.S. On the same server with Exchange there's SQL Server 2000 with SP4,
which I believe installs latest ADO 2.8...? So should not be the ADO
problem...
Back to top
talk_positive
Guest





Posted: Wed Aug 31, 2005 2:55 pm    Post subject: Re: Unable to create CDO.Message for Workflow application Reply with quote

Hi Tom....

Seems Me and Alexander are in the same boat. Like him i too have given the
account i am using to create and run the workflow all the possible
preivilages. I have gone thru the walkthru atleast 3 times to ensure that i
haven's missed anything.

One thing to note is....I am able to create CDO object and send mail when i
run the code in ASP page in browser. So...i think this is some internal
problem in, maybe workflow engine.

- Anoop
Back to top
Alexander Alexeev
Guest





Posted: Wed Aug 31, 2005 4:59 pm    Post subject: Re: Unable to create CDO.Message for Workflow application Reply with quote

Oh yeah, one more thing to add as well. I have successfully managed to
create CDO.Message object and send emails from a WSH script, *.js in my
case. Also, I tried substituting the CDO object in the Walkthrough code with
largely trouble free ADODB.Connection and FileSystemObject - just to check
if they are created - and nope, they could not be created for the same
reasons. So yes, it does seem to suggest there is something to be looked at
in the workflow engine.

Any ideas?
Thanks
Alex A
Back to top
Alexander V. Alexeev
Guest





Posted: Fri Sep 02, 2005 8:59 am    Post subject: Possible solution Reply with quote

Hi again,

Last night found a solution to this and hopefully it will do the trick for
your environment too.

1. Open the Workflow Designer and the project
2. In the Solution Explorer right-click on the ProcessName.wdf and select
Properties
3. Tick the checkbox Run workflow in priviledged author context
4. Select Ok and Save the project.

Now you should be able to save the items in the folder and have the
CDO.Message thing created by wf script and actually send messages!

Regards,
Alex A
Back to top
 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server Dedicated Servers
Contact Us
New Topics Powered by phpBB