Problem in CDO.iMailBox

I am working on code sending email in MS-Access using Exchange Server 2000. I grab the code from  http://msdn.microsoft.com/library/default.asp url=/library/en-us/e2k3/e2k3/_cdo_imailbox_interface.asp. Now my problem is casting CDO.Person to CDo.iMailbox
    iPer.DataSource.Open "LDAP://" & Info.UserName '==> This line give me iPer obj
    Set iMbx = iPer '==>This line is not able to convert properly.
    msgbox(iMbx.Basefolder) '==>This line is giving me a error

I am totally blank here. If anybody now how to solve this or did solve it. Pleas hemp me out.

Viral Parikh



Answer this question

Problem in CDO.iMailBox

  • sensores

    Hi Viral, Idea
    if you use cdo your program must run on the exchange server.
    see SDK documentation

    summary ExOLEDB:
    The ExOLEDB provider is a server-side component, and is therefore used only to access public stores and mailbox stores that reside on the same server. You can, however, access data on the server remotely by wrapping functionality into Component Object Model (COM) components, which can be utilized by ASP and other Web applications. The ExOLEDB provider is also ideal for use in COM+ components and Exchange store event and workflow sinks that run on the server. To access remote public stores and mailbox stores, use the WebDAV protocol, MAPI, or CDO 1.2.1.

    is it your case
    Bye Enrico

  • Thomas Greenleaf

    You might be surprised (Laugh), but I am tring to develope an application in VBA Access, which sends emails. Previously I am using Outlook to performe this task. Due to security patch of microsoft, Now what happening here is, everytime when application try to send email (try to create object of MailItem), it asks the user to confirm to allow this process. So, if application sending 1000 email, user needs to click 'OK' in message box 1000 times. To avoide this, I am trying to give solution with CDO.  Now, for this application to develope a COM is not fisible at all. And one more this it not at all possible to depoly any application on exchange server as it is in very secure environment. So now, I am in search of very easy, compact and non complex solution for this.

    Viral

  • Stewart Button

    Me too.

    I'm using the latest version of SDK for exchange 2000. I tried to use the example "Email Sample" provided with the SDK and i noticed that i can send mail but i cannot read the content of the mailbox.

    This method doesn't set the Imailbox right. why

     Set iMailbox = iPerson.GetInterface("IMailbox")

    I tried too open the person using the below condition

    iPerson.DataSource.Open "mailto: add@test.it"
    iPerson.DataSource.Open "LDAP: xxxxxxx"

    In both cases the object CDO.Person is right setted.

    I'm working on a pc that is connected on the same domain of exchange.

    Thank's a lot Enrico

  • Adam007x

    Have you tried making sure that you're running the code on the exchange server

    You need to be logged in as a user that has permissions for the mailbox you're trying to read.

    If you're not logged into the Exchange server as the person who's mailbox you're trying to read or as a user that has such privilages then you will most likely have hassles.

    Regards,

    Richard


  • Problem in CDO.iMailBox