Return emails in outlook

Posted on 2004-04-08
Last Modified: 2010-05-02
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

then the next one might be

subject: return failure
Body: the email could not be sent 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.
Question by:Hook333
  • 2
  • 2
LVL 76

Expert Comment

by:David Lee
ID: 10785958
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.
LVL 76

Expert Comment

by:David Lee
ID: 10786264
This might be of interest too.

Author Comment

ID: 10786827
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!

Author Comment

ID: 11440665
I answered this question myself.  Sorry it took me so long to reply I was on vacation.

Accepted Solution

modulo earned 0 total points
ID: 11441384
PAQed, with points refunded (500)

Community Support Moderator

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now