You mean you want to create a kind of TCP/IP scanner, and capture all outgoing e-mails? If yes, try to find something on the web. (Why reinvent the wheel?) I simply tried background capture email with Google, and, although not all links give what you want, there are several that do. Cheers,
Nico