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
M HTML email signature in Outlook Using Outlook 1
M Respond to Outlook Email Outlook VBA and Custom Forms 0
U Outlook locking up when replying to Email Using Outlook 7
S Email Generated from another program and then edited sends original email. Using Outlook 2
G Forward email body to other mail list directly from Exchange server Exchange Server Administration 1
S Unable to extract text from an Outlook email message Using Outlook 2
T Original email text not shown when replying or forwarding the email. Using Outlook 6
H Search Email Header for Content Type Outlook VBA and Custom Forms 1
A VBA Script - Print Date between first email in Category X and last email in Category Y Outlook VBA and Custom Forms 3
P Sending email from outlook IMAP to GMAIL where embedded images are added as attachment Using Outlook 1
D auto forward base on email address in body email Outlook VBA and Custom Forms 0
P How did hacker cause link to delete and archive containing email? Using Outlook 6
I 'quote marks' around email name Using Outlook 1
N contact list seen in Contact folder but knot in Address book or when 'TO' button is clicked in new email Using Outlook 0
T Junk Email does not get added to the Blocked Sender List Using Outlook 0
P i-Phone 6s Plus receiving 2 notifications from Outlook email Using Outlook 1
C WARNING - DO NOT USE AN OUTLOOK.COM ADDRESS FOR GOOGLE ACCOUNT RECOVERY EMAIL Using Outlook 10
T Why is every new email pinned (to keep it on top)? Windows 10 Using Outlook 6
M Outlook, send to > mail recipient - results in plain text email Using Outlook 1
P Can I create a Rule that sends me an email when I get a Task? Using Outlook 3
M Issue transferring Outlook 2016 email accounts & settings onto new computer Using Outlook 8
R Auto Assign Category colours to Incoming Emails based on whom the email is addressed Outlook VBA and Custom Forms 3
S Outlook email to configure setup for each mail Outlook VBA and Custom Forms 1
S Macro to extract email addresses of recipients in current drafted email and put into clipboard Outlook VBA and Custom Forms 2
A Is there an ID field you can use to pair a reply to the sent email? Outlook VBA and Custom Forms 4
C Auto Run VBA Code on new email Outlook VBA and Custom Forms 1

Similar threads

Top