Looking for email address under ItemSend event

Status
Not open for further replies.
B

BVM

Hi,

I need to retrieve recipients' email addresses and sender's email address when an ItemSend event is raised. I just cannot get them, even I use Redemption MapiUtils. Like string lsAddresseeEmail = (string)utils.HrGetOneProp(mail.Recipients[1].AddressEntry.MAPIOBJECT, PrSMTPAddress);

Is it because the email has not really been sent, so I cannot get them? Is there any way to get the email addresses?

I am using Windows XP, Outlook 2003 and VS2005

Thanks,

Danny
 
Can you access othe rproperties (such as PR_DISPLAY_NAME)?

Note that PR_SMTP_ADDRESS is not guarentee to be present.

Secondly, keep in mind that MAPIUtils object is being deprecated, use RDOSession instead.

Off the top of my head:

set Session = CreateObject("Redemption.RDOSession")

Session.MAPIOBJECT = Application.Session.MAPIOBJECT

> ...

set AE = Session.GetAddressEntryFromID(mail.Recipients[1].EntryID)

MsgBox AE.SmtpAddress

Dmitry Streblechenko (MVP)

-

"BVM" <DennisH@TBH.com.au> wrote in message news:OafLpRE3KHA.4336@TK2MSFTNGP04.phx.gbl...

Hi,

I need to retrieve recipients' email addresses and sender's email address when an ItemSend event is raised. I just cannot get them, even I use Redemption MapiUtils. Like string lsAddresseeEmail = (string)utils.HrGetOneProp(mail.Recipients[1].AddressEntry.MAPIOBJECT, PrSMTPAddress);

Is it because the email has not really been sent, so I cannot get them? Is there any way to get the email addresses?

I am using Windows XP, Outlook 2003 and VS2005

Thanks,

Danny
 
Another thing to make sure of is that the item is saved before you try to

read many of the properties, otherwise they won't be populated yet.

"Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message

news:eBX3WTG3KHA.4016@TK2MSFTNGP05.phx.gbl...

Can you access othe rproperties (such as PR_DISPLAY_NAME)?

Note that PR_SMTP_ADDRESS is not guarentee to be present.

Secondly, keep in mind that MAPIUtils object is being deprecated, use

RDOSession instead.

Off the top of my head:

set Session = CreateObject("Redemption.RDOSession")

Session.MAPIOBJECT = Application.Session.MAPIOBJECT

> ..

set AE = Session.GetAddressEntryFromID(mail.Recipients[1].EntryID)

MsgBox AE.SmtpAddress

Dmitry Streblechenko (MVP)

-
 
Thanks, Dmitry.

I can get Display Name, RDOSession works fine for retrieving recipients email address. But how to get sender's email address?

Thanks,

Danny

"Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message news:eBX3WTG3KHA.4016@TK2MSFTNGP05.phx.gbl...

Can you access othe rproperties (such as PR_DISPLAY_NAME)?

Note that PR_SMTP_ADDRESS is not guarentee to be present.

Secondly, keep in mind that MAPIUtils object is being deprecated, use RDOSession instead.

Off the top of my head:

set Session = CreateObject("Redemption.RDOSession")

Session.MAPIOBJECT = Application.Session.MAPIOBJECT

> ..

set AE = Session.GetAddressEntryFromID(mail.Recipients[1].EntryID)

MsgBox AE.SmtpAddress

Dmitry Streblechenko (MVP)

-

"BVM" <DennisH@TBH.com.au> wrote in message news:OafLpRE3KHA.4336@TK2MSFTNGP04.phx.gbl...

Hi,

I need to retrieve recipients' email addresses and sender's email address when an ItemSend event is raised. I just cannot get them, even I use Redemption MapiUtils. Like string lsAddresseeEmail = (string)utils.HrGetOneProp(mail.Recipients[1].AddressEntry.MAPIOBJECT, PrSMTPAddress);

Is it because the email has not really been sent, so I cannot get them? Is there any way to get the email addresses?

I am using Windows XP, Outlook 2003 and VS2005

Thanks,

Danny
 
Byt he time ItemSEnt evenbt is fired, the sender properties (RDOMail.Sender) are not yet set. That will happen later when teh mesage is moved to the Sent Items folder. You can use Items.ItemAdd even on the Sent Items folder to take advantage of that.

Otherwise you ca look at the RDOMail.Account property - for the RDOPOP3Account obejct you will be able to retrieve teh address related properties. If the mesage is beign sent through teh default account (RDOMial.Account = null), use the RDOSession.CurrentUser object.

Dmitry Streblechenko (MVP)

-

"BVM" <DennisH@TBH.com.au> wrote in message news:e0iqAZQ3KHA.3844@TK2MSFTNGP05.phx.gbl...

Thanks, Dmitry.

I can get Display Name, RDOSession works fine for retrieving recipients email address. But how to get sender's email address?

Thanks,

Danny

"Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message news:eBX3WTG3KHA.4016@TK2MSFTNGP05.phx.gbl...

Can you access othe rproperties (such as PR_DISPLAY_NAME)?

Note that PR_SMTP_ADDRESS is not guarentee to be present.

Secondly, keep in mind that MAPIUtils object is being deprecated, use RDOSession instead.

Off the top of my head:

set Session = CreateObject("Redemption.RDOSession")

Session.MAPIOBJECT = Application.Session.MAPIOBJECT

> ..

set AE = Session.GetAddressEntryFromID(mail.Recipients[1].EntryID)

MsgBox AE.SmtpAddress

Dmitry Streblechenko (MVP)

-

"BVM" <DennisH@TBH.com.au> wrote in message news:OafLpRE3KHA.4336@TK2MSFTNGP04.phx.gbl...

Hi,

I need to retrieve recipients' email addresses and sender's email address when an ItemSend event is raised. I just cannot get them, even I use Redemption MapiUtils. Like string lsAddresseeEmail = (string)utils.HrGetOneProp(mail.Recipients[1].AddressEntry.MAPIOBJECT, PrSMTPAddress);

Is it because the email has not really been sent, so I cannot get them? Is there any way to get the email addresses?

I am using Windows XP, Outlook 2003 and VS2005

Thanks,

Danny
 
Thanks, Dmitry.

Do you mean I can watch the Sent Items folder? I can get notified everytime an email moved to that folder? I want this feature too. Where can I start with, ActiveExplorer()?

Thanks,

Danny

"Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message news:O$qh8M$3KHA.4336@TK2MSFTNGP04.phx.gbl...

Byt he time ItemSEnt evenbt is fired, the sender properties (RDOMail.Sender) are not yet set. That will happen later when teh mesage is moved to the Sent Items folder. You can use Items.ItemAdd even on the Sent Items folder to take advantage of that.

Otherwise you ca look at the RDOMail.Account property - for the RDOPOP3Account obejct you will be able to retrieve teh address related properties. If the mesage is beign sent through teh default account (RDOMial.Account = null), use the RDOSession.CurrentUser object.

Dmitry Streblechenko (MVP)

-

"BVM" <DennisH@TBH.com.au> wrote in message news:e0iqAZQ3KHA.3844@TK2MSFTNGP05.phx.gbl...

Thanks, Dmitry.

I can get Display Name, RDOSession works fine for retrieving recipients email address. But how to get sender's email address?

Thanks,

Danny

"Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message news:eBX3WTG3KHA.4016@TK2MSFTNGP05.phx.gbl...

Can you access othe rproperties (such as PR_DISPLAY_NAME)?

Note that PR_SMTP_ADDRESS is not guarentee to be present.

Secondly, keep in mind that MAPIUtils object is being deprecated, use RDOSession instead.

Off the top of my head:

set Session = CreateObject("Redemption.RDOSession")

Session.MAPIOBJECT = Application.Session.MAPIOBJECT

> ..

set AE = Session.GetAddressEntryFromID(mail.Recipients[1].EntryID)

MsgBox AE.SmtpAddress

Dmitry Streblechenko (MVP)

-

"BVM" <DennisH@TBH.com.au> wrote in message news:OafLpRE3KHA.4336@TK2MSFTNGP04.phx.gbl...

Hi,

I need to retrieve recipients' email addresses and sender's email address when an ItemSend event is raised. I just cannot get them, even I use Redemption MapiUtils. Like string lsAddresseeEmail = (string)utils.HrGetOneProp(mail.Recipients[1].AddressEntry.MAPIOBJECT, PrSMTPAddress);

Is it because the email has not really been sent, so I cannot get them? Is there any way to get the email addresses?

I am using Windows XP, Outlook 2003 and VS2005

Thanks,

Danny
 
No, call Namespace.GetDefaultFolder(olFolderSentMail) (get back MAPIFolder), read MAPIFolder.Items property and store it in a global (class) variable.

You will need Items.ItemAdd event

Dmitry Streblechenko (MVP)

-

"BVM" <DennisH@TBH.com.au> wrote in message news:u92ZzeC4KHA.5880@TK2MSFTNGP04.phx.gbl...

Thanks, Dmitry.

Do you mean I can watch the Sent Items folder? I can get notified everytime an email moved to that folder? I want this feature too. Where can I start with, ActiveExplorer()?

Thanks,

Danny

"Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message news:O$qh8M$3KHA.4336@TK2MSFTNGP04.phx.gbl...

Byt he time ItemSEnt evenbt is fired, the sender properties (RDOMail.Sender) are not yet set. That will happen later when teh mesage is moved to the Sent Items folder. You can use Items.ItemAdd even on the Sent Items folder to take advantage of that.

Otherwise you ca look at the RDOMail.Account property - for the RDOPOP3Account obejct you will be able to retrieve teh address related properties. If the mesage is beign sent through teh default account (RDOMial.Account = null), use the RDOSession.CurrentUser object.

Dmitry Streblechenko (MVP)

-

"BVM" <DennisH@TBH.com.au> wrote in message news:e0iqAZQ3KHA.3844@TK2MSFTNGP05.phx.gbl...

Thanks, Dmitry.

I can get Display Name, RDOSession works fine for retrieving recipients email address. But how to get sender's email address?

Thanks,

Danny

"Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message news:eBX3WTG3KHA.4016@TK2MSFTNGP05.phx.gbl...

Can you access othe rproperties (such as PR_DISPLAY_NAME)?

Note that PR_SMTP_ADDRESS is not guarentee to be present.

Secondly, keep in mind that MAPIUtils object is being deprecated, use RDOSession instead.

Off the top of my head:

set Session = CreateObject("Redemption.RDOSession")

Session.MAPIOBJECT = Application.Session.MAPIOBJECT

> ..

set AE = Session.GetAddressEntryFromID(mail.Recipients[1].EntryID)

MsgBox AE.SmtpAddress

Dmitry Streblechenko (MVP)

-

"BVM" <DennisH@TBH.com.au> wrote in message news:OafLpRE3KHA.4336@TK2MSFTNGP04.phx.gbl...

Hi,

I need to retrieve recipients' email addresses and sender's email address when an ItemSend event is raised. I just cannot get them, even I use Redemption MapiUtils. Like string lsAddresseeEmail = (string)utils.HrGetOneProp(mail.Recipients[1].AddressEntry.MAPIOBJECT, PrSMTPAddress);

Is it because the email has not really been sent, so I cannot get them? Is there any way to get the email addresses?

I am using Windows XP, Outlook 2003 and VS2005

Thanks,

Danny
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
B Looking to get the Recipient email address (or even the "friendly name") from an email I am replying to using VBA Outlook VBA and Custom Forms 4
Aussie Looking for Outlook macro to Copy Recipient Names into Email Body Outlook VBA and Custom Forms 3
J Looking for a solution (maybe an add-in) to easily track email conversations Using Outlook 3
sophievldn Looking for a macro that moves completed items from subfolders to other subfolder Outlook VBA and Custom Forms 7
C Looking for feedback on new Outlook Add-in Using Outlook 0
B Looking to filter (or just find/search) for only messages that the sender has sent more than 1 messa Using Outlook 2
G Looking for help with our Organization Forms Library Outlook VBA and Custom Forms 1
peacepanda How to save attachment looking at the attachment name Outlook VBA and Custom Forms 1
D Looking to move away from exchange to outlook.com Using Outlook 4
B Looking for Outlook 2013 update for Send Drafts Macro Using Outlook 4
M Looking for options and best practices for an Edge Server (Exchange or not) Exchange Server Administration 0
M Looking for trainer in Business Contact Manager BCM (Business Contact Manager) 0
O looking to bring in all my folders from Outlook Express (XP) to Outlook 2013 Using Outlook 3
B Looking for an add-in or a way to send automatic replies based off a list Using Outlook 2
R Outlook Template: Looking to distribute a VBA Outlook template to other people Using Outlook 1
I Looking for a productivity add-in similar to "Nostalgy" for Thunderbird Using Outlook 5
Q Looking for Outlook 2010 Close Event Id Exchange Server Administration 1
C Looking for way to tie a Business Contact to more than one Account BCM (Business Contact Manager) 5
J OL2003 Macro disables itself - looking for way to automate 'enable' Using Outlook 2
R Looking for my BCM backup files BCM (Business Contact Manager) 1
S Looking for client-side method (Outlook 2007/Exchange 2007) for users to delete Outlook VBA and Custom Forms 2
S Looking for a Utility for Editting An Exported Rules (.rwz) File Using Outlook 6
P Outlook looking for Copy of Outlook.pst Outlook VBA and Custom Forms 1
U looking for feedback on installation process and on eMarking Assis Outlook VBA and Custom Forms 1
P Email address auto-completes work fine on laptop, but no longer on desktop Using Outlook 0
S Create Outlook Task from Template and append Body with Email Body Outlook VBA and Custom Forms 4
H Copying email address(es) in body of email and pasting in To field Outlook VBA and Custom Forms 1
A Search folder and move the email Outlook VBA and Custom Forms 0
P VBA to add email address to Outlook 365 rule Outlook VBA and Custom Forms 0
farrissf Outlook 2016 Optimizing Email Searches in Outlook 2016: Seeking Insights on Quick Search vs Advanced Search Features Using Outlook 0
D Delete selected text in outgoing email body Outlook VBA and Custom Forms 0
F Graphics in email / Mac recipient garbled Using Outlook 0
D Outlook VBA forward the selected email to the original sender’s email ID (including the email used in TO, CC Field) from the email chain Outlook VBA and Custom Forms 3
Witzker Outlook 2019 Macro to seach in all contact Folders for marked Email Adress Outlook VBA and Custom Forms 1
E Outlook 365 Save Selected Email Message as .msg File - oMail.Delete not working when SEARCH Outlook VBA and Custom Forms 0
S Email Macros to go to a SHARED Outlook mailbox Draft folder...NOT my personal Outlook Draft folder Using Outlook 2
R Outlook 365 VBA AUTO SEND WITH DELAY FOR EACH EMAIL Outlook VBA and Custom Forms 0
G Print email attachments when hit subfolder Outlook VBA and Custom Forms 1
C Spam Email? Using Outlook 2
G Automatically delete email when a condition is met Outlook VBA and Custom Forms 1
E Save Selected Email Message as .msg File - digitally sign email doesn't works Outlook VBA and Custom Forms 1
S Email was migrated from GoDaddy to Microsoft exchange. We lost IMAP ability Exchange Server Administration 1
R Outlook 365 How to integrate a third-party app with Outlook to track email and sms? Using Outlook 2
S Paperclip icon shows without attachment in email under Sent folder Using Outlook 0
B Outlook 2019 Automatically move email after assigning category Using Outlook 4
Rupert Dragwater How to permanently remove an email address Using Outlook 9
K vba code to auto download email into a specific folder in local hard disk as and when any new email arrives in Inbox/subfolder Outlook VBA and Custom Forms 0
F Auto changing email subject line in bulk Using Outlook 2
F Want to add second email to Outlook for business use Using Outlook 4
kburrows Outlook Email Body Text Disappears/Overlaps, Folders Switch Around when You Hover, Excel Opens Randomly and Runs in the Background - Profile Corrupt? Using Outlook 0

Similar threads

Back
Top