I need to write a windows service that cycles through email messages in an Exchange public folder. I've been unsuccessful with CDO trying to connect to a MAPI.session in a service. The setup I have works fine in a windows form application, but not in a service.
This is what works in a form:
dim mapiSession as new mapi.session
strExchangeServer = "mail.domain.local"
strUserAlias = "myusername"
strProfileInfo = strExchangeServer + vblf + strUserAlias
mapiSession.Logon ("","",False,True,0,True,s
trProfileI
nfo)
Works perfectly except for the obvious fact that it needs user interaction. This program needs to be installed on a server and started automatically and run regardless of whether someone is logged on or not. The error I get when I try to run this in a service is [Collaboration data Objects -[E_FAIL(80004005)]]
I don't care about using CDO - in fact, I'd rather not. I can change settings on the Exchange server to make whatever needs to be accessible accessible. I just need someone to give me a way to connect to the public folder and access the messages in a windows service. Anyway that gets done is good with me.
Start Free Trial