I'm programing an email "sidekick" program. The program needs to automatically collect the addresses of anyone I email to from my normal email program. I figure I need to listen to my outgoing smpt traffic and pull out the "To:", "CC:" and "BCC" addresses. I plan to leave the program running all the time. It checks my mail for me and deletes any mail that isn't from my whitelist. But I don't want to have to add addresses to my whitelist manually. I'm hoping on giving this program to my friends so they can use it with whatever email program they are using.

I've tried a few sniffer programs before, but they don't pick up what I need.

If anyone out there knows of some code that will help me out, I'd be thankfull.