How to get the recipient's email address in Redemption?

B

Bingo

I use Redemption's SafeRecipient to get both name and
email address for each recipient. This works fine for
all my external users but for internal users (on Exchange
Server), the Address property returns the following string

/O=CompanyName/OU=State/CN=RECIPIENTS/CN=Name

How do I get the email addresses for these users in
Redemption? Thanks.
 
D

Dmitry Streblechenko \(MVP\)

You will need to read either the PR_SMTP_ADDRESS (0x39FE001E) or
PR_EMS_AB_PROXY_ADDRESSES (0x800F101E) property using
Recipient.AddressEntry.Fields()

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

Bingo

That solved the issue for recipients. What about for the
sender's email address? Thanks.
 
D

Dmitry Streblechenko \(MVP\)

Same thing - SafeMailItem.Sender is Redemption.AddressEntry, same as
Recipient.AddressEntry, so SafeMailItem.Sender.Fields() will work the same
way.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Joined
Mar 30, 2010
Messages
1
Reaction score
0
Following is C# code which I wrote to extract email address.

RDOSession objNsp = new RDOSession();
objNsp.Logon(null, null, false, true, false, false);



RDOMail Item = objNsp.GetMessageFromMsgFile(MSGFilePath, false);



int PR_SENDER_ADDRTYPE = (0xC1E001E);

int PR_EMAIL = (0x39FE001E);



Redemption.SafeMailItem objSMail = null;

Redemption.AddressEntry objSenderAE = null;



System.Type objDocType = System.Type.GetTypeFromProgID("Redemption.MAPIUtils");

object objDoc = System.Activator.CreateInstance(objDocType);

Redemption.MAPIUtils Utils = (Redemption.MAPIUtils)objDoc;

Utils.MAPIOBJECT = Item.Session.MAPIOBJECT;



System.Type objSafeMailType = System.Type.GetTypeFromProgID("Redemption.SafeMailItem");

object safeMailType = System.Activator.CreateInstance(objSafeMailType);

objSMail = (Redemption.SafeMailItem)safeMailType;

objSMail.Item = Item;



objSenderAE = objSMail.Sender;

if (objSenderAE != null)

{

object strType = objSMail.get_Fields(PR_SENDER_ADDRTYPE);

string emailType = (string)strType;

if (emailType == "SMTP")

{

senderAddress = objSenderAE.SMTPAddress;

}

else if (emailType == "EX")

{

object a = objSenderAE.get_Fields(PR_EMAIL);

}

else

{

senderAddress = objSenderAE.Address;

}

}



objSMail = null;

objSenderAE = null;

The problem is that I get the senderAddress as ‘null’ when the emailType is “EX”. Your help is approceiated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top