C++ MAPI: MAPILogonEx, how to open default mail inbox?

烈酒焚心 提交于 2019-12-02 07:16:09

问题


I want to login to my default mail inbox via:

MAPILogonEx(0, profileName, NULL, MAPI_LOGON_UI, &lpMAPISession)

where I defined profileName as:

LPTSTR profileName = _T("Default");

However this doesn't work and tells me that I supplied an invalid profilename.

What would be the correct value for the variable profileName to login to the default mail inbox?


回答1:


Its actually really easy once you know... but you can also waste half a day on it..

Just call:
MAPILogonEx(0, 0, NULL, MAPI_LOGON_UI | MAPI_USE_DEFAULT , &lpMAPISession);

I'm still unable to supply a profilename but the default one will do the trick for now.



来源:https://stackoverflow.com/questions/20561415/c-mapi-mapilogonex-how-to-open-default-mail-inbox

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!