Capturing Email Addresses

S

scott

I need the ability to capture all email addresses that are invalid for a
newsletter i send out. I know I can create a rule that moves them to a
specific folder, but is there any way via VBA to add them to a contacts
folder?

my thinking is if i can isolate the bad emails to a specific folder, i then
could import into an access mdb file and then run a sql statement deleting
them from the full newsletter recipients database.

any ideas?
 
G

Guest

Are the delivery of non-deliverable receipts the criteria you use to gauge
whether your addresses are invalid?

If so, you can create rules that can move these messages based on the
Message Class value of "REPORT.IPM.Note.NDR". However, it may be difficult
to accurately capture the e-mail address that the bounced message was
attempting to deliver to. It may be in some MAPI properties of the NDR
message, or it could be inside the body of the NDR that you can extract.

If you can get this address, then you can perhaps do a lookup against an
existing Contact, add a Contact, or do something with your database. I'm not
exactly sure what you are trying to do here though.
 
S

scott

these would be non-deliverable. Now that I think of it, their email
addresses would only appear within the message.

Knowing this, do you think it's possible to capture the addresses within the
message?
 
S

scott

also, i wanted to add that these emails are being generated by asp code, not
outlook itself.
 
G

Guest

Sure it is possible, but can you rely on the address appearing at a certain
position or after/before expected words? If you can't, then you can always
rely on searching for an instance of "@".

If the e-mails are being generated by an application, ASP or otherwise, you
may also be able to build-in some logic for placing the address with the
message body for easy retrieval by another process that's aware of this logic.
 
S

scott

If I hide their email address right after body tage like
<body>[email protected]

Can you provide some code to extract it or point to an example that goes
through each message in a folder and adds that email to a contacts folder?
 
G

Guest

Normally I'd whip up some code for you, but I'm slammed today and am going
out of town.

Check out the InStr function for test parsing, and iterate through the
Inbox's MAPIFolder.Items collection to retrieve items. User the
Application.CreateItem method to make a Contact.

If you need help, check out http://www.outlookcode.com.
 
A

Alan

"Eric Legault [MVP - Outlook]"
<[email protected]>
wrote in message
Sure it is possible, but can you rely on the address appearing at a
certain position or after/before expected words? If you can't, then
you can always rely on searching for an instance of "@".

This *could* give a false result though.

For example, if you send to an employee who has moved on and you got a
bounce saying something like:

Alan has moved on. Please send future emails to (e-mail address removed) who
has taken over his position as Purchasing Officer.

If you already had Bob in your database you might find that you now
removed him, which is not what you'd want.


We always process bounces manually to avoid this type of issue, but
our biggest individual list in one about 500 addresses, and the number
of bounces each run is never more than a dozen or so making a manual
process feasible.

HTH,

Alan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top