How can I programmatically get a list of all users I can send “On Behalf Of” or “Send As”.
I have written a C# Winforms program that allows users to send emails via the Outlook Object Model. I allow users to
“Send As” another user if they have permission to do so. I do this using the SentOnBehalfOf property on the Email
Item (I believe this corresponds to PR_SENT_REPRESENTING_NAME).
Being the nice guy I am I thought it would be nice
to give the user a dropdown list of other users they can “send as” and “send on behalf of”. This
allows me to pre-validate the value of “SentOnBehalfOf” and prevent failure to send.
the list of users who have delegated me using Active Directory and the publicDelegatesBL property. But this doesn’t
appear to give a definitive list.
I’ve noticed the following:
1. If another user makes me a
delegate by adding an AD group which I am member of to their delegate list (in Outlook), they do not appear in my
2. At one client the publicDelegatesBL property, which is a collection contained something other than the string I was
expecting. I have not been able to reproduce it or work out what it was. Initially I thought it may have returned an AD group
object, but I haven’t been able to replicate that in my testing.
3. In addition to delegates users can also be granted “Send As” on another mailbox via Active directory. I
found information about getting a list of people who can “Send As” me by looking at my mailbox permissions,
however I cannot work out how to get a list of users I can “Send As”.
I’d really like some
- All the different ways that I can get permission to send on behalf of another person.
I’m really confused and can’t find a definitive list anywhere.
- Any variations on this process between Exchange Versions.
- What can I expect back in the publicDelegatesBL property collection?
- Has to
run on the client, not the Exchange Server.
- Must support multiple versions of Exchange
- Supports Outlook 2003/2007/2010 for sending.
Any help would be very gratefully received.