hi, all,
I want to get Email Address throught global contacts by using MAPI.
First, I create MAPI session, And get Address Handle, and then revoke
contact Handle and the revoke GetContentsTable to trace table content.
I set TAG Flag
SizedSPropTagArray( 5, sptCols ) = {
5,PR_ENTRYID,PR_DISPLAY_NAME,PR_ACCOUNT,PR_EMAIL_ADDRESS};
and use
PpropFindProp(pRows->aRow[i].lpProps,pRows->aRow[i].cValues, TAG_FLAG)
ervery tag works pretty well.
Only PR_EMAIL_ADDRESS,I can not get what I want to get.
It return:
/o=mycompany/ou=First Administrative Group/cn=Recipients/cn=jeff
What I want is jeff@mycompany.com
How to retrive this Email Address Property?
Thanks
Dan Mitchell - 24 Oct 2005 17:51 GMT
> Only PR_EMAIL_ADDRESS,I can not get what I want to get.
> It return:
> /o=mycompany/ou=First Administrative Group/cn=Recipients/cn=jeff
You need to read PR_EMS_AB_PROXY_ADDRESSES -- that's a multi-valued
property which contains all the email addresses for the user. That list
will contain their SMTP address -- maybe multiple ones if there's more
than one that's valid for a person, so you'll have to decide which one to
use. The one which has "SMTP:foo@bar.com" rather than "smtp:foo@bar.com"
(ie SMTP is in uppercase) is the default one.
(you'll need to think about what you should do if they really do have
multiple addresses -- I'm "danielm@company.com" but also
"danielmitchell@company.com", both addresses will get to me, so which one
is the "correct" one?)
You could also try reading property 0x39fe001e, that's normally the
default smtp address -- though that property isn't documented so it may
not be 100% reliable.
-- dan
jeff - 24 Oct 2005 21:45 GMT
Hi, Dan.
Thanks for your reply.
I have tried PR_EMS_AB_PROXY_ADDRESSES this property tag.
However it still does not give me what you wrote below.
I have tried 0x39fe001e, it works pretty well.
you have mentioned me that it is not docment -ed.
I am not sure that:is it some relative with Exchanger server version?
my Exhcange server is :2003
I have sseen some doc on google said:there is some difference with
version:5.5/2000 and 2003.
but they did not say the difference.
Currently, my project works.I will work my project on differen exchange
server version
Thanks again
> > Only PR_EMAIL_ADDRESS,I can not get what I want to get.
> > It return:
[quoted text clipped - 17 lines]
>
> -- dan
Dan Mitchell - 24 Oct 2005 22:09 GMT
> I have tried PR_EMS_AB_PROXY_ADDRESSES this property tag.
> However it still does not give me what you wrote below.
What _is_ in there? Have you tried looking with outlookspy/mdbview?
> I have tried 0x39fe001e, it works pretty well.
> you have mentioned me that it is not docment -ed.
> I am not sure that:is it some relative with Exchanger server version?
I don't think it changes with server version, and I've never heard of
anybody having a problem with this -- it's just not documented so
"officially", it may not work. In real life, it seems to be fine.
> Currently, my project works.I will work my project on differen
> exchange server version
That's always the best idea -- if you do find a situation where it
doesn't work it would be nice to know about it.
-- dan