A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Looking for email address under ItemSend event



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 15th 10, 03:33 AM posted to microsoft.public.outlook.program_addins
BVM
external usenet poster
 
Posts: 15
Default Looking for email address under ItemSend event

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
Ads
  #2  
Old April 15th 10, 07:29 AM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Looking for email address under ItemSend event

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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"BVM" wrote in message ...
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
  #3  
Old April 15th 10, 01:53 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Looking for email address under ItemSend event

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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Dmitry Streblechenko" wrote in message
...
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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-

  #4  
Old April 19th 10, 08:05 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Looking for email address under ItemSend event

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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"BVM" wrote in message ...
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" wrote in message ...
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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"BVM" wrote in message ...
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
  #5  
Old April 20th 10, 02:18 AM posted to microsoft.public.outlook.program_addins
BVM
external usenet poster
 
Posts: 15
Default Looking for email address under ItemSend event

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" wrote in message ...
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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"BVM" wrote in message ...
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" wrote in message ...
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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"BVM" wrote in message ...
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
  #6  
Old April 22nd 10, 07:02 AM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Looking for email address under ItemSend event

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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"BVM" wrote in message ...
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" wrote in message ...
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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"BVM" wrote in message ...
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" wrote in message ...
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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"BVM" wrote in message ...
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
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ItemSend event not firing PatrickS Outlook and VBA 2 August 4th 09 03:59 PM
Hooking up the ItemSend Event... Marketware Add-ins for Outlook 1 May 20th 09 05:22 AM
No entryid on Itemsend Event [email protected] Add-ins for Outlook 3 March 2nd 09 04:20 PM
Can I capture the event ItemSend from a macro? Totem Outlook and VBA 13 April 25th 08 02:05 PM
ItemSend Event Catalin Outlook and VBA 4 January 17th 08 07:17 PM


All times are GMT +1. The time now is 09:18 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.