Y
Yaroslav
Hello,
I need to get the sender address using MAPI.
I have several accounts in outlook. When I select one of them in the inspector window and send message I need to know the address of this account.
I tried this code
Outlook::_NameSpacePtr pNS = pApplication->GetNamespace(L"MAPI");
Outlook::RecipientPtr pSender = pNS->GetCurrentUser();
senderAdr =pSender->GetAddress();
but it always give me the same address (address of the first account). Also I tried get the property PR_SENDER_EMAIL_ADDRESS from the message but get an error that this property is not found.
Please, advise what to do to get the current sender address?
I need to get the sender address using MAPI.
I have several accounts in outlook. When I select one of them in the inspector window and send message I need to know the address of this account.
I tried this code
Outlook::_NameSpacePtr pNS = pApplication->GetNamespace(L"MAPI");
Outlook::RecipientPtr pSender = pNS->GetCurrentUser();
senderAdr =pSender->GetAddress();
but it always give me the same address (address of the first account). Also I tried get the property PR_SENDER_EMAIL_ADDRESS from the message but get an error that this property is not found.
Please, advise what to do to get the current sender address?