Currently we are using Microsoft ews-java-api to interact with mailboxes on Office 365 and it works fine. We are trying to make switch to Aspose.Email and to use IEWSClient instead with the same connection details but we are facing an issue:
java.lang.IllegalStateException: class com.aspose.email.system.exceptions.WebException: Error: 2 (No connection could be made because the target machine actively refused it.) —> class com.aspose.email.system.exceptions.SocketException: No connection could be made because the target machine actively refused it.
The code used to connect to Office 365 EWS is:
NetworkCredential credentials = new NetworkCredential(user_name, password); WebProxy proxy = new WebProxy(“PROXY IP”, 8080); IEWSClient _client = EWSClient.getEWSClient(“[https://outlook.office365.com/EWS/Exchange.asmx ](https://outlook.office365.com/EWS/Exchange.asmx)”, credentials, proxy);
Any help would be appreciated. Thanks