Link to home
Start Free TrialLog in
Avatar of Hook333
Hook333

asked on

Return emails in outlook

I have a visual basic program that will parse emails.  What I need to do is take emals that are returned to us and parse out the email address that it was originally sent to and mark it in our database as a bad email address.  I started doing this but it seems that most of the return emails are in different formats.  Example  

subject: return failure
body: this is bad joe@hotmail.com

then the next one might be

subject: return failure
Body: the email could not be sent
joe@hotmail.com was a bad email address

I am just looking for an easy way of processing these returns and marking them in the database so we can remove them after so many returns.
Avatar of David Lee
David Lee
Flag of United States of America image

If you don't mind using CDO then the code sample in this Microsoft article will return the SMTP header for each message.  You can parse that header and find the name and email address the message was originally sent to.  I imagine that'll be a difficult process though since it's reasonable to anticipate that different email systems will generate different header formats.  I played around with this and looked at what was returned in a non-delivery report message.  The address of the original recipient is there, but I don't know what logic could be employed to make finding it either easy or a sure thing.

http://support.microsoft.com/?kbid=194870
This might be of interest too.

http://www.mapilab.com/dev/mapiprop/
Avatar of Hook333
Hook333

ASKER

Thanks for trying but I have written a program just to go ahead and parse the emails as i need to look for key words like "quota" ect.  I will just have to look for a bunch of possibilities in my code.  I do not need an answer for this anymore!
Avatar of Hook333

ASKER

I answered this question myself.  Sorry it took me so long to reply I was on vacation.
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial