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

Free Support Forum - aspose.com

Aspose.Email.Exchange.EWSClient' threw an exception

Hello,

I’m using Aspose.Email for .NET 6.1.0.0 / Exchange Server 2013

I’m getting this error message : Error message “The type initializer for ‘Aspose.Email.Exchange.EWSClient’ threw an exception.”

Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

_Hresult 2146233036

Can someone help me please ? this is the code :

Dim mailboxURI As String = "https://server/ews/exchange.asmx"

Dim username As String = " username"

Dim password As String = " password"

Dim domain As String = " domain"

Dim credential As NetworkCredential = New NetworkCredential(username, password, domain)

Dim client As IEWSClient = EWSClient.GetEWSClient(mailboxURI, credential)

Hi Serge,

Thank you for contacting Aspose support team.

I have tested the scenario using following sample code but could not observe any issue. Could you please give it a try using latest library Aspose.Email for .NET 17.5.0 and share the feedback?

const string mailboxUri = “https://outlook.office365.com/ews/exchange.asmx”;

const string domain = @"";

const string username = @"testaccount";

const string password = @"password";

NetworkCredential credentials = new NetworkCredential(username, password, domain);

IEWSClient client = EWSClient.GetEWSClient(mailboxUri, credentials);

If issue is not resolved, please share the test account credentials temporarily for our testing here.

When i was using the previous version (spose.email 1.8.0.0) I was able to connect to the exchange server 2013 with the code below :

Private Function GetAsposeEWSClient() As ExchangeWebServiceClient


Dim mailboxURI As String = "https://server/ews/exchange.asmx"

        Dim username As String = "username"
        Dim password As String = "password
        Dim domain As String = “domain”

' Connect to the Exchange Server

Dim credential As NetworkCredential = New NetworkCredential(username, password, domain)

Dim client As ExchangeWebServiceClient = New ExchangeWebServiceClient(mailboxURI, credential)


' return the instance of ExchangeWebServiceClient class

Return client

End Function

And now i’m using the new Aspose.Email for .NET 6.1.0.0 with the code below and I’m getting an error message :

Dim mailboxURI As String = " https://server/ews/exchange.asmx" 
Dim username As String = " username"
        Dim password As String = " password"
        Dim domain As String = " domain" 
Dim credential As NetworkCredential = New NetworkCredential(username, password, domain)

Dim client As IEWSClient = EWSClient.GetEWSClient(mailboxURI, credential)

è Error message “The type initializer for ‘Aspose.Email.Exchange.EWSClient’ threw an exception.”

Hi Serge,

Thank you for writing us back.

It is always recommended to use latest version as latest version is equipped with new features and fixes for the bugs (if any) reported by the customers. Please download the latest version of Aspose.Email for .NET 17.5.0 and give it a try at your end.

Hi,

I used the last version of Aspose.Email for .NET 17.5.0 but is not working

error message :The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

Hi Serge,


I have tried again to re-produce this issue using latest library Aspose.Email for .NET 17.5.0 but failed. Please note that here at Aspose assistance is provided only for the latest version.

I am afraid that this issue requires your test account credentials temporarily, which can be used to re-produce the issue here and provide assistance. Without the test account it is not possible to analyze the issue and assist you further.

We are sorry for the inconvenience caused to you in this regard.