Discussion:
Looking for email address under ItemSend event
(too old to reply)
BVM
2010-04-15 02:33:57 UTC
Permalink
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
Dmitry Streblechenko
2010-04-15 06:29:11 UTC
Permalink
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" <***@TBH.com.au> wrote in message news:***@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
Ken Slovak - [MVP - Outlook]
2010-04-15 12:53:47 UTC
Permalink
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" <***@dimastr.com> wrote in message news:***@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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
BVM
2010-04-16 01:41:29 UTC
Permalink
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" <***@dimastr.com> wrote in message news:***@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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"BVM" <***@TBH.com.au> wrote in message news:***@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
Dmitry Streblechenko
2010-04-19 19:05:58 UTC
Permalink
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" <***@TBH.com.au> wrote in message news:***@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" <***@dimastr.com> wrote in message news:***@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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"BVM" <***@TBH.com.au> wrote in message news:***@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
BVM
2010-04-20 01:18:23 UTC
Permalink
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" <***@dimastr.com> wrote in message news:O$qh8M$***@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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"BVM" <***@TBH.com.au> wrote in message news:***@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" <***@dimastr.com> wrote in message news:***@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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"BVM" <***@TBH.com.au> wrote in message news:***@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
Dmitry Streblechenko
2010-04-22 06:02:11 UTC
Permalink
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" <***@TBH.com.au> wrote in message news:***@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" <***@dimastr.com> wrote in message news:O$qh8M$***@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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"BVM" <***@TBH.com.au> wrote in message news:***@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" <***@dimastr.com> wrote in message news:***@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)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"BVM" <***@TBH.com.au> wrote in message news:***@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
carlos monwel
2011-02-19 19:02:16 UTC
Permalink
to fashionable floors 3325 chesapeake va23519 0r 604bravo ct suffolk va 23434the ware house
This is a multi-part message in MIME format.
------=_NextPart_000_0006_01CADC97.EB03FD00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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 =3D =
(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
------=_NextPart_000_0006_01CADC97.EB03FD00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2912" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Hi,</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>I need to retrieve recipients' email addresses and =
sender's=20
email address when an ItemSend event is&nbsp;raised. I just cannot get =
them,=20
even I use Redemption MapiUtils. Like <FONT color=3D#0000ff=20
size=3D2>string</FONT><FONT size=3D2> lsAddresseeEmail =3D (</FONT><FONT =
color=3D#0000ff=20
size=3D2>string</FONT><FONT=20
size=3D2>)utils.HrGetOneProp(mail.Recipients[1].AddressEntry.MAPIOBJECT, =
PrSMTPAddress);</FONT></FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Is it because the email has not really been sent, so =
I cannot=20
get them? Is there any way to get the email addresses?</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>I am using Windows XP, Outlook 2003 and =
VS2005</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Thanks,</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Danny</FONT></DIV></BODY></HTML>
------=_NextPart_000_0006_01CADC97.EB03FD00--
This is a multi-part message in MIME format.
------=_NextPart_000_041D_01CADC2A.49E0B200
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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.
set Session =3D CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT =3D Application.Session.MAPIOBJECT
...
set AE =3D Session.GetAddressEntryFromID(mail.Recipients[1].EntryID)
MsgBox AE.SmtpAddress
--=20
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
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 =3D =
(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
------=_NextPart_000_041D_01CADC2A.49E0B200
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META name=3DGENERATOR content=3D"MSHTML 8.00.6001.18876">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2 face=3DArial>Can you access othe rproperties (such =
as=20
PR_DISPLAY_NAME)?</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial>Note that PR_SMTP_ADDRESS is not =
guarentee to be=20
present.</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial>Secondly, keep in mind that MAPIUtils =
object is=20
being deprecated, use RDOSession instead.</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2 face=3DArial>Off the top of my head:</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2 face=3DArial>set Session =3D=20
CreateObject("Redemption.RDOSession")<BR>Session.MAPIOBJECT =3D=20
Application.Session.MAPIOBJECT</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial>...</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial>set AE =3D =
Session.GetAddressEntryFromID(<FONT=20
face=3D"Times New Roman">mail.Recipients[1].EntryID</FONT>)</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial>MsgBox AE.SmtpAddress</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial></FONT>&nbsp;</DIV>
<DIV><BR>-- <BR>Dmitry Streblechenko (MVP)<BR><A=20
href=3D"http://www.dimastr.com/">http://www.dimastr.com/</A><BR>OutlookSp=
y&nbsp; -=20
Outlook, CDO<BR>and MAPI Developer Tool<BR>-</DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; =
PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"=20
dir=3Dltr>
<DIV>"BVM" &lt;<A =
wrote in message <A=20
=
<DIV><FONT size=3D2>Hi,</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>I need to retrieve recipients' email addresses and =
sender's=20
email address when an ItemSend event is&nbsp;raised. I just cannot get =
them,=20
even I use Redemption MapiUtils. Like <FONT color=3D#0000ff=20
This is a multi-part message in MIME format.
------=_NextPart_000_0041_01CADC79.29576F70
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Another thing to make sure of is that the item is saved before you try to
read many of the properties, otherwise they will not 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
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.
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
-
------=_NextPart_000_0041_01CADC79.29576F70
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META name=3DGENERATOR content=3D"MSHTML 8.00.6001.18904">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2 face=3DArial>Another thing to make sure of is that =
the item is=20
saved before you try to read many of the properties, otherwise they =
will not be=20
populated yet.</FONT></DIV>
<DIV><BR>-- <BR>Ken Slovak<BR>[MVP - Outlook]<BR><A=20
href=3D"http://www.slovaktech.com">http://www.slovaktech.com</A><BR>Autho=
r:=20
Professional Programming Outlook 2007.<BR>Reminder Manager, Extended =
Reminders,=20
Attachment Options.<BR><A=20
href=3D"http://www.slovaktech.com/products.htm">http://www.slovaktech.com=
/products.htm</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; =
PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"=20
dir=3Dltr>
<DIV>"Dmitry Streblechenko" &lt;<A=20
message=20
<A=20
=
<DIV><FONT size=3D2 face=3DArial>Can you access othe rproperties (such =
as=20
PR_DISPLAY_NAME)?</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial>Note that PR_SMTP_ADDRESS is not =
guarentee to be=20
present.</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial>Secondly, keep in mind that MAPIUtils =
object is=20
being deprecated, use RDOSession instead.</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2 face=3DArial>Off the top of my head:</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2 face=3DArial>set Session =3D=20
CreateObject("Redemption.RDOSession")<BR>Session.MAPIOBJECT =3D=20
Application.Session.MAPIOBJECT</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial>...</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial>set AE =3D =
Session.GetAddressEntryFromID(<FONT=20
face=3D"Times New =
This is a multi-part message in MIME format.
------=_NextPart_000_000C_01CADD59.C101A9E0
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
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
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.
set Session =3D CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT =3D Application.Session.MAPIOBJECT
...
set AE =3D Session.GetAddressEntryFromID(mail.Recipients[1].EntryID)
MsgBox AE.SmtpAddress
--=20
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
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 =3D =
(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
------=_NextPart_000_000C_01CADD59.C101A9E0
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2900.2912" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Thanks, Dmitry.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I can get Display Name, RDOSession =
works fine for=20
retrieving recipients email address. But how to get sender's email=20
address?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Danny</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Dmitry Streblechenko" &lt;<A=20
message=20
<A=20
=
<DIV><FONT face=3DArial size=3D2>Can you access othe rproperties (such =
as=20
PR_DISPLAY_NAME)?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Note that PR_SMTP_ADDRESS is not =
guarentee to be=20
present.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Secondly, keep in mind that MAPIUtils =
object is=20
being deprecated, use RDOSession instead.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Off the top of my head:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>set Session =3D=20
This is a multi-part message in MIME format.
------=_NextPart_000_0076_01CADFB8.ABFF9230
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
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 =3D null), use the RDOSession.CurrentUser object.
--=20
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
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
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.
set Session =3D CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT =3D Application.Session.MAPIOBJECT
...
set AE =3D Session.GetAddressEntryFromID(mail.Recipients[1].EntryID)
MsgBox AE.SmtpAddress
--=20
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
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 =3D =
(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
------=_NextPart_000_0076_01CADFB8.ABFF9230
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Dgb2312" http-equiv=3DContent-Type>
<META name=3DGENERATOR content=3D"MSHTML 8.00.6001.18904">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2 face=3DArial>Byt he time ItemSEnt evenbt is fired, =
the sender=20
properties (RDOMail.Sender) are not yet set. That will happen later when =
teh=20
mesage is moved to the Sent Items folder. You can use Items.ItemAdd even =
on the=20
Sent Items folder to take advantage of that.</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial>Otherwise you ca look&nbsp;at the =
RDOMail.Account=20
property - for the RDOPOP3Account obejct you will be able to retrieve =
teh=20
address related properties. If the mesage is beign sent through teh =
default=20
account (RDOMial.Account =3D null), use the RDOSession.CurrentUser=20
object.</FONT></DIV>
<DIV><BR>-- <BR>Dmitry Streblechenko (MVP)<BR><A=20
This is a multi-part message in MIME format.
------=_NextPart_000_000A_01CAE07B.3074A330
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
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()?=20
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 =3D null), use the RDOSession.CurrentUser object.
--=20
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
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
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.
set Session =3D CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT =3D Application.Session.MAPIOBJECT
...
set AE =3D =
Session.GetAddressEntryFromID(mail.Recipients[1].EntryID)
MsgBox AE.SmtpAddress
--=20
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
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 =3D =
(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
------=_NextPart_000_000A_01CAE07B.3074A330
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2900.2912" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Thanks, Dmitry.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Do you mean I can watch the Sent Items =
folder? I=20
This is a multi-part message in MIME format.
------=_NextPart_000_0098_01CAE1A6.ACBA1F20
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
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
--=20
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
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()?=20
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 =3D null), use the RDOSession.CurrentUser object.
--=20
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
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
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.
set Session =3D CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT =3D Application.Session.MAPIOBJECT
...
set AE =3D =
Session.GetAddressEntryFromID(mail.Recipients[1].EntryID)
MsgBox AE.SmtpAddress
--=20
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
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 =3D =
(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
------=_NextPart_000_0098_01CAE1A6.ACBA1F20
Content-Type: text/html;
charset="gb2312"
Submitted via EggHeadCafe
SharePoint Tip / Thought of the Day WebPart
http://www.eggheadcafe.com/tutorials/aspnet/14280ff8-3c9f-46bd-8214-9267e613c8ec/sharepoint-tip--thought-of-the-day-webpart.aspx
Loading...