MAPI question about extra info in email and smtp address

  • Thread starter Thread starter Aamir
  • Start date Start date
A

Aamir

Hello,

I am trying to get the PR_EMAIL_ADDRESS_W and PR_SMTP_ADDRESS_W
properties from a MAPI table. I expect to see text of the usual form:

(e-mail address removed)

but instead I sometimes see things like:
* John
* (e-mail address removed) (John Doe)

Any ideas on why? I don't understand why this extraneous information
would appear in these fields.

Thanks so much for any help!

Aamir
 
Sorry for the delay - here is the basic gist of what I have. I looked
online and found a few caveats on using cached exchange mode - any
insights you have about that and this in general are very
appreciated.

Thanks so much to any and all with input.

private List<String> GetRecipientAddresses(RDOMail rdoMail){
MAPITable mapiTable = rdoMail.Recipients.MAPITable;
mapiTable.Columns = { PR_ADDRTYPE_W, PR_DISPLAY_NAME_W,
PR_SMTP_ADDRESS_W, PR_EMAIL_ADDRESS_W, PR_RECIPIENT_TYPE,
PR_DISPLAY_TYPE };
mapiTable.GoToFirst();

List<String> addresses = new List<String>();

Object[] rows;
while((rows = (Object[])mapiTable.GetRows(32)) != null) {
foreach(Object[] row in rows) {
// the following line just sets up a dictionary for key ->
value mappings
IPropertyMap propertyMap = new
KeyValueRowSource(desiredPropertyKeys, row);
String address = GetAddress(propertyMap);
addresses.Add(address);
}
}

return addresses;
}

private static String GetAddress(IPropertyMap recipient) {
String address;

String psAddressType = recipient.GetProperty<String>(PR_ADDRTYPE_W)
as String;
switch(psAddressType) {
case "EX":
address = recipient.GetProperty<String>(PR_SMTP_ADDRESS_W) as
String;
break;

case "SMTP":
address = recipient.GetProperty<String>(PR_EMAIL_ADDRESS_W)
as String;
break;
}

return address;
}
 
Oh, and to be clear, I'm pretty sure the SMTP case in GetAddress is
the one that produces the extra data instead of a pure address.
 
Are you sure you defined PR_EMAIL_ADDRESS_W and PR_SMTP_ADDRESS_W correctly?
What do yo usee in OutlookSpy (click IMessage, go to the GetRecipientTable
tab)?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
Hi Dmitry,

Unfortunately I am hearing about this from a user, so I don't have an
email to check in OutlookSpy.

PR_EMAIL_ADDRESS_W = 0x3003001F
PR_SMTP_ADDRESS_W = 0x39FE001F
 
The tags look fine to me.
Can you ask your user to install OutlookSpy? Or at least save the message as
an MSG file and zip it?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
Back
Top