trying to get recipient email address

T

TMJNSK

Hi All,

I have tried access sender's email and receiver's email. I have found
a code to get sender's email.I have used Redemption.safermailitem,
which works cool. But i have trouble in getting the receiver email
address.

I have tried the following items (sample code got it from internet)
Dim utils, MailItem, PrSMTPAddress, SMTPAddress
utils = CreateObject("Redemption.MAPIUtils")
PrSMTPAddress = &H39FE001E
'Get SMT P address of the first recipient. It is
assumed that the recipient is an Exchange Server user.
SMTPAddress =
utils.HrGetOneProp(oMailItem.Recipients(1).AddressEntry.MAPIOBJECT,
PrSMTPAddress)
LogMessage("Receiver Address" + SMTPAddress)

But i am getting the following error at the place of HrGetOneProp -
System.Runtime.InteropServices.COMException (0xA5120009): Property is
read-only.
at Outlook.AddressEntry.set_MAPIOBJECT(Object MAPIOBJECT)
at
DIAMSXe_OutlookAddIn.XMailItem.btnAttachToDIAMSXe_Click(CommandBarButton
ctrl, Boolean& cancel) at Outlook.AddressEntry.set_MAPIOBJECT(Object
MAPIOBJECT)
at
DIAMSXe_OutlookAddIn.XMailItem.btnAttachToDIAMSXe_Click(CommandBarButton
ctrl, Boolean& cancel)Property is read-only.

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.



Issue number 2:
Dim utils1, MailItem1, PrSenderEmailAddress,
SenderEMail
utils1 = CreateObject("Redemption.MAPIUtils")
PrSenderEmailAddress = &HC1F001E
SenderEMail =
utils1.HrGetOneProp(oMailItem.MAPIOBJECT, PrSenderEmailAddress)
LogMessage("Sender Address" + SenderEMail)

When i used this for sender's email, i was getting
"/O=COMPANYDOMAIN/OU=FIRST ADMINISTRATIVE GROUP/CN=RECIPIENTS/
CN=RECEIVERNAME.. "
Is this going to be the same for receiver email too?

Actually, i am looking for Email id. Can some one help me here.
 

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