Connecting to Exchange Server

In order to connect to Exchange servers 2007, 2010 and 2013 using Exchange Web Service, Aspose.Email provides the IEWSClient interface that implements the EWSClient class. The EWSClient.GetEWSClient method instantiates and returns an IEWSClient object that is further used to perform operations related to an Exchange mailbox and other folders. This article shows how to instantiate objects of IEWSClient.

Connecting to Exchange Server using EWS

The following code snippet shows you how to connect using Exchange Web Service (EWS).

Connecting to Exchange Server using IMAP

Microsoft Exchange Server supports the IMAP protocol for accessing items in a mailbox. Use Aspose.Email’s ImapClient class to connect to the Exchange Server using the IMAP protocol. For more information about the ImapClient class. First, make sure that IMAP services are enabled for your Exchange Server:

  1. Open the Control Panel.
  2. Go to Administrator Tools, then Services.
  3. Check the status of the Microsoft Exchange IMAP4 service.
  4. If it is not already running, enable/start it.

The following code snippet shows you how to connect and list messages from the Inbox folder of Microsoft exchange server using IMAP protocol.

The following code snippet shows you how to use SSL.

After connecting to an Exchange server using IMAP and getting the IMapMessageInfoCollection, The following code snippet shows you how to use the MessageInfo object’s sequence number to save a specific message.