MapiLogon() questiong about user supplied profile and password

J

Jim

Hi everyone:
I'm writing a program which try to receive emails from exchange
server.The enviroment is Exchange 2003 runing on Windows 2000 server and
Outlook 2000 runing on Widows XP.And the client logs on the domain as a
domain memeber. I want to use MapiLogon() (or MapiLogonEx() ) with sepecific
logfile so I call MapiLog() like the following:
(FARPROC&) lpfnMAPILogon = GetProcAddress(m_dllhandle,"MAPILogon");
(FARPROC&)lpfnMAPIFindNext =
GetProcAddress(m_dllhandle,"MAPIFindNext");
ULONG lResult = pfnMAPILogon
(NULL,"MyProfile","12345",MAPI_NEW_SESSION|MAPI_FORCE_DOWNLOAD ,NULL,
&mapiSession);
lResult = lpfnMAPIFindNext(mapiSession, NULL, NULL,pMessageID, 0,0,
pMessageID);
"MyProfile" is an outlook profile name i have created and "12345" is
the password of the corresponding mail account in the exchange server. But
when I debug the code i found that pfnMAPILogon() returned 0 but
lpfnMAPIFindNext() returned 3(which is MAPI_E_LOGIN_FAILURE).I have been
confused about it for several days. Could anybody give me any advices?

thanks a lot.

Jim
 
Top