Getting messages from Exchange 2003
We are automating test cases, and one particular test case involves making the application send an email, and verifying that the email has been received.
I'd like to (somehow) con开发者_如何转开发nect to the exchange server (2003) using a given user account and pull the inbox messages, and make sure the message i am expecting was received.
There are limitations to this scenario:
These tests will often be performed in a lab environment, with no outside connectivity to the internet. This means the server (exchange) has to reside in our envinronment (cannot use Gmail for example).
EWS and newer APIs cannot be used since they are supported from Exchange 2007 and up.
Tried a few mentioned techniques on the net with no success (WebDAV for example).
Is there a reliable source for getting this requirement done? what technique would you recommend?
Redemption is one option; it uses MAPI directly. Outlook is not required.
That being said, WebDAV is a valid option here. You'll need do execute two steps:
- Issue a SEARCH command on the mailbox in question.
- If you need the entire mail in MIME format, issue a GET on the href returned b the Search request. Add a "Translate: f" header to the request. If you just want to examine the mail in a structured way, issue a PROPFIND on the href instead.
I have a library which does all this stuff. If you ping me through my website (http://www.infinitec.de), I can send it to you.
You can problably use the Redemption library.
The library uses Outlook as an entry point to Exchange, which means that you'll have to install and configure Outlook on th emachine running your tests. My guess is that since this is just for testing purposes, that is an acceptable limitation.
精彩评论