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.
Thread starter Similar threads 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
T I am looking for a Microsoft Outlook Email Stationery download? Using Outlook 5
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
U Looking for a person/company that we can PAY for Outlook 2003 tech service Using Outlook 0
P Looking for Christmas Theme (thmx file) Using Outlook 5
D Microsoft Outlook not operating and is clouded looking Using Outlook 1
B Outlook 2007 at odd times shuts down then states it is looking for problem then starts up again Using Outlook 1
S Outlook 2003 (when looking at emails shows my name and not who sent the emails) Using Outlook 2
W "Looking for credential tiles..." when connecting to Exchange 2007 Using Outlook 4
S Outlook wont load - looking for microsoft exchange Using Outlook 1
M I am looking for support options for taskmanager in 2010 Using Outlook 1
P Looking for suggestions regarding a multi-site high availability/disaster resistant design Exchange Server Administration 1
S Looking for feedback on this CAS Array testing plan Exchange Server Administration 2
R Complicated mixed exchange environment, looking to move to 2010! Exchange Server Administration 8
C Looking for Collaboration / Communication Tools Using Outlook 4
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 Sending email from Office 365 alias in Outlook Using Outlook 4
S Macro or plug-in to see if specific person was included in this email Outlook VBA and Custom Forms 3
S Body text of Email from invite date/time Outlook VBA and Custom Forms 8
R Outlook 2010 How do you export 2 email Accounts' 2010 Inbox Files to new computer (2019)? Using Outlook 1
R Auto display of new email does not work on non-default account Outlook VBA and Custom Forms 0
J Automatically forward email and apply template Outlook VBA and Custom Forms 0
L Outlook saved email templates Using Outlook 1
B VBA to convert email to task, insert text of email in task notes, and attach copy of original email Outlook VBA and Custom Forms 4
T How can you include Junk Email in Search Results like you can include Deleted Items? Using Outlook 3
B Extracting email addresses from a folder - how to also get the name of the person the address is for? Using Outlook 5
W Replyin to the reply-to email address Outlook VBA and Custom Forms 0
E How to display "Change Folder" in Change Default Email Delivery Location in Exchange Outlook 2016 Using Outlook 1
M Extract all links from Outlook email, send to Excel Using Outlook 2
O Forward a email with modified body Automatically. Outlook VBA and Custom Forms 0
Similar threads


















































Top