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
 
D

Dmitry Streblechenko

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
 
K

Ken Slovak - [MVP - Outlook]

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)

-
 
B

BVM

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
 
D

Dmitry Streblechenko

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
 
B

BVM

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
 
D

Dmitry Streblechenko

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
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
L Looking for help - want to try an alternative to Outlook? Outlook Wishlist 0
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
D Forwarding email based on the attachment file type and specific text found on the attachment file name Outlook VBA and Custom Forms 0
F Forward incoming email with 4 embedded images in the body without original sender Outlook VBA and Custom Forms 10
W Macro to Filter Based on Latest Email Outlook VBA and Custom Forms 6
D Create advanced search (email) via VBA with LONG QUERY (>1024 char) Outlook VBA and Custom Forms 2
C Outlook 2007 Removing then adding account restores junk email processing Using Outlook 0
G Place jpg in body of email Outlook VBA and Custom Forms 1
F Wishlist Outlook suddenly began synchronizing deleted items every time I delete a single email. Using Outlook 2
N Save Selected Email Message as .msg File Outlook VBA and Custom Forms 12
HarvMan Toggle between calendar and email in Outlook 365 Using Outlook 12
F Email being marked as Spam by Gmail and not being visible in Outlook Using Outlook 5
G Email time stamp Using Outlook 2
G Schedule recurring email and attachments display Outlook VBA and Custom Forms 3
G Save and Rename Outlook Email Attachments Outlook VBA and Custom Forms 0
B Need to Copy an email to a subfolder Outlook VBA and Custom Forms 2
M How to setup outlook after importing old account information - Entering email account info creates with "(1)" after the account! Using Outlook 1
K Multiple Rules on Single Email Using Outlook 2
F VBA to move email from Non Default folder to Sub folders as per details given in excel file Outlook VBA and Custom Forms 11
e_a_g_l_e_p_i Outlook 2010 How to set default email address for website links Using Outlook 3
O Same email address, same person, names in so many ways Using Outlook 4
D Create new email from the received Email Body with attachment Outlook VBA and Custom Forms 10
D Outlook launch email showing new unread email in reading pane Using Outlook 11
B Zoom automatically next email item (VBA) Outlook VBA and Custom Forms 2
K Outlook adds space to rows in HTML email signatures viewed on mobile Using Outlook 1
M HTML email signature in Outlook Using Outlook 3
M Respond to Outlook Email Outlook VBA and Custom Forms 0
U Outlook locking up when replying to Email Using Outlook 7

Similar threads

Top