After rounds of discussions with Dmitry. I was able to solve my problem as following -
I already had LeagcyDN or exchange name of the user, so from that I created the EntryId of Sender.
Get the IAddrBook* from IMAPSupport as following - lpMAPIsupport->OpenAddressBook(NULL, 0, &lpAddrBook);
Get the MAPI properties of sender from the Addressbook pointer of the user.
Get the PR_DISPLAY property of the sender from MAPI properties.
Perhaps following code will help to understand
hrRet = lpMAPIsupport->OpenAddressBook(NULL, 0, &lpAddrBook);
if (SUCCEEDED(hrRet) && lpAddrBook != NULL )
{
hrRet = lpAddrBook->OpenEntry(cbEntryID, lpEntryID, &IID_IMAPIProp, 0, &ulEntryType,
(LPUNKNOWN *)&lpMapiProp);
if (SUCCEEDED(hrRet) && lpMapiProp != NULL )
{
HrGetOneProp(lpMapiProp, PR_DISPLAY_NAME_W, true, UserName);
}
}
Note - If you don't have LegacyDN then you can extract that from PR_STORE_ENTRYID property of the message.
Thanks Dmitry.