We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Object reference exception connecting to Exchange 2013

Calling GetEWSClient(mailboxuri, username, password,domain) in Aspose.Email 4.9 throws an “Object reference not set to an instance of an object.” exception when connecting to an Exchange 2013 mail server. This problem doesn’t happen with Aspose.Email 4.8

Hi Ralph,

Thank you for contacting Aspose support team.

I have tested this issue at my end using the latest version of Aspose.Email for .NET 4.9.0 and was not able to observe any such issue as you have mentioned. In the following sample code, I have provided a test online Exchange 2013 account that you can use for your reference. Please let us know your feedback then.

Sample Code:

IEWSClient client = EWSClient.GetEWSClient(“https:[//outlook.office365.com/ews/exchange.asmx](https://outlook.office365.com/ews/exchange.asmx)”, "UserOne@ASE1982.onmicrosoft.com", “Aspose1234”);

Console.WriteLine(client.ListMessages(“inbox”).Count);

Hi JonSaffron,

Thank you for sharing your feedback.

With the above test account, I never got an exception as you have mentioned. Could you please share a test account credentials that we could use for testing at our end and report the problem to our product team. This will help us investigate the issue and assist you further.

Hi JonSaffron,

You are right. We are not always able to reproduce the issue at our end as the issue may be environment specific. That is why I requested you that if you are able to reproduce the exception with your server and can provide us with a test account on the same for our investigation, we could check it at our end by accessing it from here and share details with our product team. Also, can you please share your environment details with us like OS, .NET Framework, Antivirus installed and the VS version you are using? The information can be helpful to us in replicating the environment at our end for our investigation.

Hi JonSaffron,

Perhaps you are right as I have tested this issue at my end with Windows 2012 R2 and .NET framework 4.0. Still the issue needs to be discussed with our Product team, which I’ll follow up accordingly and if there is some news available, we’ll share with you here for your reference.

Could you please provide an update to this? I’m receiving null reference exception as well.

Hi Rory,

We have discussed this issue with our Product team as well and they were also not able to reproduce this issue at our end. As requested earlier, if a sample test account is provided that we can use to connect to from our end and reproduce it at our end, we’ll be able to report it to our Product team and share our feedback with you.

Hi JonSaffron,


We are facing issues in GetEWSClient() method for web based applications but these are working fine for command line and form based projects. The reported issue in web-based applications is as follows:

"Error: The current configuration system does not support user-scoped settings"

It is also reported that above mentioned issue is not re-producible with Aspose.Email for .NET 5.5.0 and earlier versions. Could you please test your scenario with few older versions and let us know the feedback?


The issues you have found earlier (filed as EMAILNET-34977) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.