Hi,
I’m trying to connect to an Office 365 email account using OAuth. I already have the token, so I create the OAuthNetworkCredential with it. But when I try to create the EWSClient I get a null reference exception. Through fiddler I can see it doesn’t do any request and if I try to create the client using username and password credentials, it works. Here’s the stack trace:
at Aspose.Email.Exchange.Schema.Exchange_2013.ExchangeServiceBinding.GetWebRequest(Uri uri)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Aspose.Email.Exchange.Schema.Exchange_2013.ExchangeServiceBinding.GetFolder(GetFolderType GetFolder1)
at Aspose.Email.Exchange.EWSClient.GetEWSClient(String mailboxUri, ICredentials credentials, WebProxy proxy)
at Aspose.Email.Exchange.EWSClient.GetEWSClient(String mailboxUri, ICredentials credentials)
at MyProject.Microsoft.Mail.GetItems() in C:\MyProject\Microsoft\Mail.cs:line 27