I am trying to create a simple Web page for e-mailing. Eventually I will
add more advanced features but for now I am trying to learn how to create
CDO objects in ASP pages. I am using Ed Beck’s article "Getting Started
with ASP Messaging" and I am using the code he provided. I am
implementing the authentication with Basic Authentication. I followed the
instructions and flow charts from the article to implement this logon
type. However, I receive the error message "Error: Get Inbox:
-2147221231: The information store could not be opened. [MAPI 1.0 -
[MAPI_E_LOGON_FAILED (80040111)]] GetAMSession returned nothing!". It
seems to me I am not able to log in to the mailbox at all.

Since I am afraid I am not able to log in at all, I tried the code listed
below to make sure CDO is installed correctly.
-------------------------
' Initialize error handling
On Error Resume Next


' Ask for mailbox alias
'strAlias =InputBox("Please enter the Exchange alias:", " CDO 1.21
'Login")'
strAlias = "myID"
response.write "Should have asked for Alias Name " & strAlias & "."
If Trim(strAlias) <> "" Then

' Build dynamic profile
strProfileInfo =3D "myServer" & Chr(10) & Trim(strAlias)

' Create CDO 1.21 session
Err.Clear
Set objSession =3D CreateObject("MAPI.Session")

' Check for error
If Err.Number <> 0 Then
MsgBox "Error. CDO 1.x not installed. Errorcode: " _
& Chr(13) & Err.Number & Chr(13) & Err.Description
Else

' Logon
Err.Clear
objSession.Logon "", "", False, True, 0, True, strProfileInfo
If Err.Number =3D 0 Then
MsgBox "CDO 1.x is installed. Version: " & objSession.Version
Err.Clear
Set objInbox =3D objSession.Inbox
If Err.Number =3D 0 Then
MsgBox "Successfully logged on to mailbox: " _
& objSession.CurrentUser
Else
MsgBox "Could not logon to mailbox. Errorcode: " _
& Chr(13) & Err.Number & Chr(13) & Err.Description
End If
Else
MsgBox "Could not logon to mailbox. Errorcode: " _
& Chr(13) & Err.Number & Chr(13) & Err.Description

End If

' Logoff
objSession.Logoff
End If
End If

' Tidy up
Set objSession =3D Nothing
Set objInbox =3D Nothing
----------------------
To test this new code I added a new Virtual Directory to IIS and followed
instructions for "Creating your own Anonymous User" listed in Ed Beck’s
article. This code returns "Should have asked for Alias Name myID. CDO
1.x is installed. Version: 1.21Could not logon to mailbox. Errorcode:
-2147221219 The attempt to log on to the Microsoft Exchange Server
computer has failed. [Microsoft Exchange Server Information Store -
[MAPI_E_FAILONEPROVIDER(8004011D)]]."

The IIS server is running on a Windows 2000 Server and Exchange Server 5.5
is running on a different Windows 2000 server. The IIS server has Outlook
XP installed with the Outlook CDO feature set up. To test the mailbox
and ID’s I’m using I entered the ID’s, mailbox, and passwords I’m using in
my CDO setup at the OWA page and it logs on correctly from there. The
client I am testing from and both servers log in to the same NT 4.0
Domain. Ed Beck’s instructions cover NT4.0, so I’m afraid my actions on
the Windows 2000 server are off.

Any ideas??

Here is the link to Ed Beck’s article.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnasp/html/msdn_aspmess.asp


Thanks!

Joseph White
_________________________________________________________________
List posting FAQ:       http://www.swinc.com/resource/exch_faq.htm
Archives:               http://www.swynk.com/sitesearch/search.asp
To unsubscribe:         mailto:[EMAIL PROTECTED]
Exchange List admin:    [EMAIL PROTECTED]

Reply via email to