A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

MAPI question about extra info in email and smtp address



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 29th 08, 05:56 AM posted to microsoft.public.outlook.program_addins
Aamir[_2_]
external usenet poster
 
Posts: 4
Default MAPI question about extra info in email and smtp address

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:



but instead I sometimes see things like:
* John
*
(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
Ads
  #2  
Old May 29th 08, 06:28 AM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default MAPI question about extra info in email and smtp address

Which table? See where and how? What are the erelevant snippets of your
code?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Aamir" wrote in message
...
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:



but instead I sometimes see things like:
* John
*
(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



  #3  
Old June 3rd 08, 02:07 AM posted to microsoft.public.outlook.program_addins
Aamir[_2_]
external usenet poster
 
Posts: 4
Default MAPI question about extra info in email and smtp address

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 ListString 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();

ListString addresses = new ListString();

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.GetPropertyString(PR_ADDRTYPE_W)
as String;
switch(psAddressType) {
case "EX":
address = recipient.GetPropertyString(PR_SMTP_ADDRESS_W) as
String;
break;

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

return address;
}
  #4  
Old June 3rd 08, 02:08 AM posted to microsoft.public.outlook.program_addins
Aamir[_2_]
external usenet poster
 
Posts: 4
Default MAPI question about extra info in email and smtp 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.
  #5  
Old June 3rd 08, 08:53 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default MAPI question about extra info in email and smtp 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
-
"Aamir" wrote in message
...
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 ListString 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();

ListString addresses = new ListString();

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.GetPropertyString(PR_ADDRTYPE_W)
as String;
switch(psAddressType) {
case "EX":
address = recipient.GetPropertyString(PR_SMTP_ADDRESS_W) as
String;
break;

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

return address;
}



  #6  
Old June 3rd 08, 10:20 PM posted to microsoft.public.outlook.program_addins
Aamir[_2_]
external usenet poster
 
Posts: 4
Default MAPI question about extra info in email and smtp address

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
  #7  
Old June 4th 08, 12:07 AM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default MAPI question about extra info in email and smtp address

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
-
"Aamir" wrote in message
...
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



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get SMTP address of contact that shares email address of an Exchange user Jeff Outlook and VBA 14 January 15th 09 01:50 AM
SMTP Rejected email address FyrFtrEmt Outlook Express 4 June 19th 06 12:10 AM
MAPI unable to load info Andy outlook issue Outlook - General Queries 1 April 18th 06 10:19 AM
How to determine what SMTP address email was sent to? BCole8888 Outlook - General Queries 3 February 8th 06 04:08 PM
Why do all of my contact email address have SMTP at the end? Al S. Outlook - Using Contacts 1 February 7th 06 04:32 PM


All times are GMT +1. The time now is 08:20 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.