Do you know if there's a way?
I've used this library to access a pop3 server, but it doesn't work with an exchange server.
Do you know of any other library or piece of code that'll show me how to do it?
I cannot change any settings on the server.
Do you know if there's a way?
I've used this library to access a pop3 server, but it doesn't work with an exchange server.
Do you know of any other library or piece of code that'll show me how to do it?
I cannot change any settings on the server.
You need to use the Exchange SDK if POP3 is not enabled in the Exchange Server. Another options is to use WebDAV.
Depends on the Exchange version. WebDAV works with 2000 thru 2007, but Web Services requires 2007+.
Those are probably the easiest to get working. CDO is another option, but it's not supported from C# - so you'll have to go out of proc.
Exchange also has an OLEDB provider, but I've never used it - it is supported from .NET, however.
You could use this library: http://www.dimastr.com/redemption/
If you use Exchange 2007 and have web services enabled, this is pretty easy. I added a 2.0-style classic Web Reference to my VS2008 project, and I can get mail messages like this:
The "messages" variable will be an array of ItemType objects returned from exchange that have all the properties you'd expect for a mail message (Body, Attachments, etc.). I hope this helps!
Another option is to configure Exchange to enable IMAP4. There exist 3rd party IMAP4 libraries for .NET, e.g. rebex.
Using EWS directly in managed code (VB.net / C#) is clumsy to say the best.
I've been fumbling around with it for a few days now, and have come to the conclusion that it's better to build my own wrapper classes around the API, making the services usable in a line or two of code, not the page with the current implementation.
Guess what? Microsoft have beaten me to it: Exchange Web Services Managed API's first Release Candidate is available for download here.
Install, register the dll reference (\Program Files\Microsoft\Exchange\Web Services\1.0\Micorosft.Exchange.WebServices.dll), and import the namespace (Microsoft.Exchange.WebServices.Data) and you're ready to roll.