C++ MAPI: MAPILogonEx, how to open default mail in

2019-03-02 12:11发布

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?

标签: c++ email mapi
1条回答
我想做一个坏孩纸
2楼-- · 2019-03-02 12:23

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.

查看更多
登录 后发表回答