Hey guys and gals,
I have a new task set upon me in the next few weeks, and it's something I've never done before - so before I start reinventing the wheel, I thought I'd ask around and see if anyone else has done this before.
Basically an account we setup for our MS Exchange server will be receiving emails from various shipping companies (FedEx, DHL, UPS) so I will have to parse 3 different types of emails. There is a common piece of information akin to an order id in all 3 emails that I'll be parsing and storing in a SQL database for use on a central webpage that will show each user, regardless of their shipping method, the status of their order. Because we're the middleman and not the actual order processors etc, that's about as much information as I can rely on. Further, I'm not sure I can rely on the format of the emails received to not change.
So what I am envisioning right now is a parser custom written for each email based on spacing and character counts etc. Using something like a SubString() function to capture a key piece of the email, then parsing X characters after it and relying on that being correct. There are many things about this approach I don't like that I think are obvious.
I was hoping someone had experience with this before, even if it's a paid-for solution, as long as it works Im sure we'd shell out for something robust. Baring that, how would one go about gaining access to the files? It's my understanding that the files are stored as .eml - if that's correct, is there any identifiable information about the file name that would tell me that they are the files I am looking for? How does exchange store all this information, I assumed some sort of database. I did some research so far and I'm under the impression that using MIME you can at least separate the header/attachment/body/subject etc.
Thanks in advance for any advice/information you can lend.