all groups > inetserver asp components > december 2004 >
You're in the

inetserver asp components

group:

Logon Error 80070057 When Trying to Access Exchange Using CDO/MAPI


Logon Error 80070057 When Trying to Access Exchange Using CDO/MAPI TechnoFI
12/14/2004 1:03:01 PM
inetserver asp components:
Hi,

I am trying to get the address entries from Exchange using MAPI.Session
object in ASP page. My code works from VB EXE Project, but not from ASP. My
exchange server is 2003. I donot think this is a problem as the VB project
can talk to exchange server 2003 and returning the global address list.

I am getting floowing error When I am trying to Logon (Line 6 -
objSession.Logon)
Collaboration Data Objects (0x43F)
[Collaboration Data Objects - [E_INVALIDARG(80070057)]]

Here is the code.

1. Dim strProfileInfo
2. Dim oRecordSet
3. Dim objSession
4. Set objSession = Server.CreateObject("MAPI.Session")
5. strProfileInfo = "servername" & vbLf & "mailboxname"
6. objSession.Logon "", "", False, False, 0, True, strProfileInfo
7. Set objFolder = objSession.Inbox
8. Set objAddrList = objSession.AddressLists("Global Address List")
9. Set objAddrEntries = objAddrList.AddressEntries

Am I missing some thing. I think this has some thing to do with the
authentication. My virtual directory has Integrated windows authentication on.

Any tips/comments welcome.
Thanks.




RE: Logon Error 80070057 When Trying to Access Exchange Using CDO/MAPI lukezhan NO[at]SPAM online.microsoft.com
12/15/2004 3:27:12 AM
Hello,

Have you disabled the anonymous access in IIS security setting? Also, what
is the protection level for your ASP application?

Luke
RE: Logon Error 80070057 When Trying to Access Exchange Using CDO/MAPI lukezhan NO[at]SPAM online.microsoft.com
12/17/2004 6:28:09 AM
Is the problem resolved? If you have any question, please feel free to let
me know.

Luke
RE: Logon Error 80070057 When Trying to Access Exchange Using CDO/MAPI Zen
1/11/2005 7:54:57 AM
Hello Luke,

I'm having a similar problem that I cannot seem to resolve.

I have my ASP page running on a server (WWW2) running Windows NT and IIS
4.0. The folder, running it's own application has security set to
Windows NT Challenge/Response only. Users have Read access to the folder
only.

I have Exchange 5.5 on a seperate server (MTLMAIL). I'm trying to send
an email using the credentials of a mailbox (mailboxAlias).

Here's my page, very simple with the function only:
#########################################
QuickStart()
' This also appears as the "QuickStart" example in "Overview"
Function QuickStart()
Const strServer = "mtlmail"
Const strMailbox = "mailboxAlias"

Dim objSession
Dim strProfileInfo
Dim objMessage ' or Dim objMessage As Message
Dim objOneRecip ' or Dim objOneRecip As Recipient

strProfileInfo = strServer & vbLf & strMailbox
Set objSession = Server.CreateObject("MAPI.Session")
objSession.Logon "domain\logon", "mypassword", False, False, 0, True,
strProfileInfo

Response.Write "CurrentUser: " & objSession.CurrentUser

' create a message and fill in its properties
Set objMessage = objSession.Outbox.Messages.Add
objMessage.Subject = "Sample Message"
objMessage.Text = "This is some sample message text."

' create the recipient
Set objOneRecip = objMessage.Recipients.Add
objOneRecip.Name = "web administration"
objOneRecip.Resolve

' send the message and log off
objMessage.Update
objMessage.Send
Response.Write "The message has been sent"
objSession.Logoff

if err.number = 0 then
Response.Write "No Error " & err.Description
else
Response.Write "Error " & err.Description
end if

End Function
#########################################


Below is the ASP error returned:

#########################################
CurrentUser: Unknown
Collaboration Data Objects error '000004f9'

The information store could not be opened. [MAPI 1.0 -
[MAPI_E_LOGON_FAILED(80040111)]]

/Document_Control/dbman/sendmail.asp, line 21
#########################################

Is it even possible to access the exchange server on a seperate machine
from WINNT 4.0/IIS 4.0?

Any help would be appreciated!

Zen

*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button