Free Support Forum -

Aspose.Email compatability in with JDK8

Continuing the discussion from Aspose.Email compatability in with JDK12 (Java):

Hi Team,
I have an requirement to read email from exchange server with JDK8 (JAVA) source code so can you please help me JAVA 8 source code to connect & read email from MS exchange server.


Thank you for your query. You can configure dependencies with Aspose.Email as below:

    <name>Aspose Java API</name>


You can connect to the exchange server as following:

final String mailboxUri = "";
final String domain = "";
final String username = "";
final String password = "password";

NetworkCredential credentials = new NetworkCredential(username, password, domain);
IEWSClient client = EWSClient.getEWSClient(mailboxUri, credentials);

More details: Connecting to Exchange Server

You can read the email from the exchange server as following:

String inboxUri = client.getMailboxInfo().getInboxUri();
ExchangeMessageInfoCollection messages = client.listMessages(inboxUri);

More details: Working with Exchange Mailbox and Messages

API Reference: IEWSClient interface

Thank you Andrey_Potapov!!! your quick reply helps me lots.