views:

22

answers:

1

Ive been trying to figure out how this situation is handled easily.

I have a website that sends out some emails. I want to be able to somehow get the bounce backs and so I can store the information in a DB table.

The main confusion comes in how is this done? I assume I create a email address that will be the FROM:. But when the email doesnt go through I assume Exchange Server would get that bounce back... does it log it somewhere? in a file? In a database? How can I read this info ?

A: 

I have built a couple of applications that process Exchange bounce backs. Generally the bounce back messages will get returned to the inbox of the FROM address on the message that you send out. So, in order to store that information in a database table, I built a windows service that would periodically read that bounce back inbox, and then log that information into a database.

I assume your using exchange; So, in order to read the bounce back information from exchange I used the Exchange Web Services, that allow you to connect to exchange and read the message contents within an inbox (in addition to a bunch of other exchange functions). From there I could process the messages and insert data into my application's database.

One thing to note, is that Exchange Web Services are only available for Exchange 2007 or later. If you're using an earlier version, then you would have to investigate other options.

Joe
I just checked.. We ar eon Exchange 2003 going to 2010 later... How do I deal with this issue genrally in 2003 ? Or maybe im better off telling them ill implement the bounceback logging functionality later (when we get 2010) .. if its really a pain in 2003
punkouter
For exchange 2003, you're options are definitely limited. In addition, if you use one of the exchange 2003 apis, you would have to re-write that once you upgrade to 2007/2010. If your administrator allows POP or IMAP access, that might be the way to go if you need to get it implemented now. You would simply connect to the inbox via a POP or IMAP client library (see http://stackoverflow.com/questions/44383/reading-email-using-pop3-in-c) and read the messages that way. If it were me I would try to hold out until the Exchange upgrade.
Joe
So I programmatically read the inbox of [email protected] .. parsing through the email subjects etc.. ? And in Exchange 2007/2010 I would use a API to read from a logfile? Do I got it straight now ?
punkouter
and why is using EWS better than just reading through POP3 ?
punkouter
It's not necessarily better. In my opinion, the "better" solution would be the one that meets your needs. I would say that using EWS would be the easier route. MS has built a really straightforward and easy API for reading Exchange messages. If you choose to use POP3, you're stuck with a number of 3rd party POP3 client libraries out on the net. Or, if you prefer not to use 3rd party tools you would have to write your own which would be more effort. Finally, not all Exchange admins allow POP3 access on Exchange accounts at all so you might have to try and convince them otherwise.
Joe