MAPI Error Number -2147221231
CDO Error Number -2147746065
The information in this article applies to: Collaboration Data Objects (CDO), versions 1.1, 1.2, 1.21
If it fails, the most likely reason is that you do not have an open session.
-or-
Here are possible reasons for this error:
The following resolutions match the causes listed in the CAUSE section.
1. If you are passing a profile name in your logon line, make sure the profile exists on the computer where the logon line runs. For a Visual Basic application running on a client, the profile must exist on the client running the application. If you are running a Web application, you should use the ProfileInfo parameter on the Logon method to create a profile programmatically instead of specifying a profile name.
When logging on to a mailbox from a server application (for example, an ASP running under IIS), be sure that you pass "False" for the ShowDialog parameter. Failure to do so could result in a MAPI_E_LOGON_FAILED error if you pass any invalid parameters.
If you are passing a ProfileInfo as part of your logon line, check the name of the mailbox and Exchange server to make sure they exists, and that the Exchange server is up.
NOTE: The Logon method can succeed even when using a resource that does not exist or invalid parameters. When you attempt to use a server resource (for example, an Outbox or an Inbox) for the first time, you get the error shown in the SYMPTOMS section. To verify that you have logged onto a valid Exchange mailbox, check the CurrentUser property of the CDO (1.1, 1.2, 1.21) Session object. This does not verify your permissions to that mailbox.)
2. To logon to a mailbox, you have to specify the owner of the mailbox as someone that has an account on the Windows NT Domain, or someone that has logon permissions to that mailbox.