开发者

Getting messages from Exchange 2003

开发者 https://www.devze.com 2023-04-11 10:33 出处:网络
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.

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:

  1. 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).

  2. EWS and newer APIs cannot be used since they are supported from Exchange 2007 and up.

  3. 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:

  1. Issue a SEARCH command on the mailbox in question.
  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号