Anthony
Tue Jan 29 16:14:31 CST 2008
<zerbie45@gmail.com> wrote in message
news:832eb222-7315-4085-8a7f-66c695d74666@e4g2000hsg.googlegroups.com...
> hello, I have an event sink that traps mail going through the smtp
> server.
>
> I need to parse the msg.to field so that I can get each single user:
> the string looks like this:
>
> "Johnny Lance (BCO-London)" <jlance@bco.net>, "lhughes@bco.net"
> <lhughes@bco.net>
>
> basically I need to get the smtp address of each recipient, the one
> between the "<" and ">". The recipents could be just one or a few. So
> I would need to cycle through this list but honestly I have no idea
> how build this array in a vbscript.
>
> Anybody can give a hand ? It would be much appreciated.
>
Note that if you're only interested in the email recipients (Whether To, CC
or even BCC) whose post boxes are in the mail domain managed the by server
you can retrieve these via the EnvelopeFields property of the msg.
Const cdoRecipientList =
"
http://schemas.microsoft.com/cdo/smtpenvelope/recipientlist"
sRecipientList = Msg.EnvelopeFields.Item(cdoRecipientList).Value
It will have the format:-
SMTP:jlance@bco.net; SMTP:lhughes@bco.net;
(assuming the SMTP server whose events you are sinking is handled the
bco.net mail domain).
--
Anthony Jones - MVP ASP/ASP.NET