extracting email address out of message body
- From: "CompleteNewb" <CompleteNewb@xxxxxxxxxxx>
- Date: Tue, 7 Aug 2007 17:55:24 -0400
I've seen some posts about this before, but the suggestions didn't work at
all when I tried them (probably my fault).
We send a newsletter out TO PEOPLE WHO SUBSCRIBE to it (we are NOT spammers,
and include opting out options in every mailing). Again, we're not
spammers, and that's why I've been charged with keeping the mailing list
clean. We get a lot of "mailbox full" or "user not found" bounces, and
after we get three of these per address, I want to take that email address
out of our distribution list.
So, I've been using Outlook to import all the bounces from our server, then
I export the bounces to Access. Now in Access I've got a "body" field that
has the entirety of the bounce message, which differs across all ISP's.
Some say the reason, some just say it didn't get through, and some have
cryptic messages that don't really say much of anything. Also, some include
the first 20 lines or whatever of the original outgoing message, some have
the whole thing, some have the plain text version, some put weird characters
in, etc. The point here is that the email address is never in the same
place, so I can't count on code that looks in a specific place inside the
body. One thing they all have, though, is the email address the original
message was sent to (I can't use the "From" filed, because it's just the
postmaster, or sysadmin, or whatever, of the ISP) SOMEWHERE in the body.
What I'd like to do is extract all the email addresses out of the bodies of
all these bounces, into a new field for that record. I tried several
permutations of my VERY limited knowledge of VBA, trying to locate the @
symbol, then getting all the characters to the right and left of the symbol
until a space is encountered. I couldn't figure out how to do this,
however.
Can someone here help me with this? I don't mind getting our own sending
address as well as the recipient's (a lot of bounces include the sender's
email address in the bounce message as well as the failed destination
address), because I figure I can run through the new field with just the
email addresses and delete our own sending address, leaving the recipient's.
Or, perhaps I'm going about it all wrong to begin with. If this is the
wrong group to post to, please help direct me to a more appropriate group if
you could.
Any help, advice, samples, etc. would be greatly appreciated, and thanks for
reading.
.
- Follow-Ups:
- Re: extracting email address out of message body
- From: John Spencer
- Re: extracting email address out of message body
- Prev by Date: Re: INSERT INTO Query Converted to VBA
- Next by Date: Re: Crosstab Combinations
- Previous by thread: Re: source database property on a query
- Next by thread: Re: extracting email address out of message body
- Index(es):
Relevant Pages
|