MAPI : When we try to access Public Folder via ASP application throws MAPI_E_FAILONEPROVIDER

Recently one of my customer updated that they get an different issue with their ASP application. This application running on their Web server that uses MAPI to read the Contacts folder in the Public Folders from Exchange Server 2003 SP2 machine. The user can retrieve his email in outlook and browse the public folders as he is used to, but when this user want to use the ASP page that reads the public folder he fails.

smile_sad Customer receives the following error:

bstrPublicRootID = objInfoStore.Fields.Item(&H66310102).Value
Error Description: [Collaboration Data Objects – [MAPI_E_FAILONEPROVIDER(8004011D)]]
number: –2147221219
Source: Collaboration Data Objects

During the the troubleshooting, we found that the customer tries to read the contacts in public folders. Customer try to gain programmatic access to Public Folders by assigning the folders collection to an object. Customer cannot gain programmatic access to a public folder from an ASP by stepping through the tree. To do this, certainly the customer needs to use GetFolder, which in turn requires him to know what the RootID of the Public Folder.

So we recommend customer to make use of MAPI property tag (example: bstrPublicRootID = objInfoStore.Fields.Item( &H66310102 ).Value) to get the root ID of the Public Folders, which resolved the issue.

lightbulbAlso in couple of earlier such scenario’s we found this error might happen due to one of the following:

You might don’t have permissions: You are trying to access a mailbox that the ASP does not have proper permission for.Check to make sure the ASP is being authenticated into the account you want. Insert this line into your VBScript to find out what account the ASP is running in:

Response.Write("You are logged on as " & Request.ServerVariables("LOGON_USER") & "<br>")

If you are logged in under the anonymous account, you will receive a blank string back.

You might be using Incompatible browser: You are using "NT Challenge Response" as your authentication type, and Netscape Navigator for your browser. Netscape Navigator does not support "NT Challenge Response" as an authentication option. In order to log onto a user’s Exchange account, the IIS authentication needs to be set up as "Basic (Clear Text)".

computer For a safer side, you need to make sure that you don’t have Exchange Server 2003 and Outlook 2003 in the same box.

thumbs_up Happy Programming!!