I'm developing a window service to send email through MAPI, utilizing the MAPI33.dll library. I installed the service in Windows Server 2003 and it works well, even with a MS Outlook application running in foreground.
However, when I login into the server through Remote Desktop session, I'm getting error MAPI_E_FAILONEPROVIDER at the OpenMsgStore method. The error will not happen if MS Outlook application is not running.
I've googled like mad, try every possible flag combinations to pass to the OpenMsgStore method, and only to discover the problem lies with the credentials of the Remote Desktop session, which I need to call mstsc with the /admin switch as below:
mstsc /admin
I've scratched my head for days and hope this finding could help someone out there.