I've been fetching value of the user name from user's profile "PR_DISPLAY_NAME" and set the same value as sender in "PR_SENDER_NAME_X" property value. But it seems outlook 2010\13 always sets the user name as email address at the time of profile creation. Even if we add the user name manually, it is replaced by the email address when outlook profile/account is created.
My questions are - How do I get the actual user's name so that I can set the same as sender name ? How does transport provider set the sender name which is displayed in From field ( "PR_SENDER_NAME_X" property value) when an email is sent? I tried searching any relevant property but couldn't find.
I am connected to exchange server 2k10 through outlook MAPI account.
At this moment I see following possibilities to get the sender name but I don't think these are the right way to fix the problem.
There is profile property PR_PROFILE_USER which consists a DN name. We can extract the user name from this property.
we have the email address, query that in the address book and get the user name from there. But I not sure if address book always keeps the current user