I'm trying to logon into Exchange Server but it fails everytime.
I'm using with reference to CDO 1.21 liberary.
I have a few lines of code on the client machine, which is operate as Admin.
Dim oSession As MAPI.Session
ReDim aMailboxList(1) As String
ReDim aserverlist(1) As String
Dim iBigLoop As Integer
Dim sServerName As String
Dim sProfileInfo As String
Dim sMailboxName As String
'TO DO: Change "ServerName" to the name of your Exchange Server
sServerName = "yudkevich.co.il"
'TO DO: Change "MailboxName" to the name of a mailbox on the
' server specified above
sMailboxName = "Mailbox - Administrator"
sProfileInfo = sServerName & vbLf & sMailboxName
Set oSession = CreateObject("MAPI.Session
")
oSession.Logon profileinfo:=sProfileInfo <<--- it fails over here
and then i'm getting a message
"Outlook code not log on. check to make sure your are connected to the network and are using the proper server and mailbox name. the connection to the MIcrosoft Exchange Server is unavailable. outlook must be online or connected to complete this action"
I'm pressing ok, and getting a message that says "run time error ... MAPI_E_LOGON_FAILED...
I know that the mailbox exists and this is the name of the Exchange Server. so what is going on ????????
Rafi
Start Free Trial