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

  • Thread starter Thread starter Bingo
  • Start date Start date
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.
 
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
 
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
 
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.
 
Back
Top