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

Can't create MAPI session

Status
Not open for further replies.

selena1

Programmer
Apr 7, 2003
69
0
0
Hi,

I've Installed Exchange Server 2007 on Windows Server 2003 SP2 machine. I need to send all broadcasted emails from ADMIN account to all newly created users. My idea is to have all this emails in draft folder of ADMIN mailbox and then using vbscript and CDO objects to send them to the users. From my PC my script works OK (I've installed MS Office Outlook 2003) except security warning ("A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this?" Need to click Yes.) But I want to run script on server. I've downloaded and installed Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 (ExchangeMapiCdo.EXE). Now I can send email using smtp:

Set objEmail = CreateObject("CDO.Message")
.
.
objEmail.Send

But when I tried to create MAPI session (I need it to read draft folder):

snServername = "xxx"
mbMailboxName = "xxx.xxx"
set objShell = CreateObject("WScript.Shell")
Set objSession = CreateObject("MAPI.Session")
objSession.Logon "","",false,true,true,true,snServername & vbLF & mbMailboxName

I got an error on line "Set objSession = CreateObject("MAPI.Session")":

activex component can't create object: 'mapi.session' 800a01ad

Why is this?

Server doesn't have any version of MS Outlook installed on it.

I have these CDO files on server:

cdosys.dll C:\WINDOWS\system32
cdoex.dll C:\Program Files\Common Files\Microsoft Shared\CDO
CDO.DLL C:\Program Files (x86)\ExchangeMapi
(and some others)

Can you help me with this?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top