Languages: I suggest PHP or Perl for what you're accomplishing, assuming you're okay with either. I'll use PHP as an example here.
Scenario 1: Access the destination account via IMAP, and use the IMAP functions
to retrieve and parse the messages. You'll see that the functions do most of the heavy lifting for you and will let you access the necessary e-mail parts reasonably directly.
Scenario 2: Access Exchange's web services via SOAP using their API (see SOAP reference here
). If I had to guess, it's more work, and you'll lock yourself into Exchange this way, as IMAP/POP3 are open standards. That's why I would go with scenario 1 if possible.
Accessing .eml files or a database directly is a bad idea in my book, even if that was possible. Any of the above scenarios provides the necessary data abstraction. For example, let us imagine that you'd access Exchange's database directly. They change a table name in the next version, your script stops working. They change a field name, your script stops working. And so on, and so on. Granted, with .eml files this would be less of a problem, but even then, let's imagine that your backend stopped using .eml files in some future version. Then you'd be screwed.