I need to send email to EWS asychronously from C#. I get that IAsyncEwsClient.SendAsync returns a Task and since I also send using SMTP synchronously I figure that’ll be similar, but to get the client you need to call the static method EWSClient.GetEwsClientAsync which returns a task and I haven’t been able to get its result. The task sits in status WaitingForActivation indefinitely. The GetAccessTokenAsync method on my token provider is getting called. I’m not passing a proxy or cancellation token. Marking the call with async would force my method to be declared asynchronously which I don’t want to do. I’m quite happy for it to wait. Is there any other sample code than the 21.9 release notes that shows how to do this?
Second thoughts: I’m getting an exception in GetEwsClientAsync. The system can’t find library Aspose.Email.XmlSerializers, Version=184.108.40.206. That didn’t appear in the NuGet package. Should it be there?
We have logged a ticket for your use case in our issue tracking system as EMAILNET-40535. We will inform you via this forum thread once there is an update available on it.
We apologize for your inconvenience.
Can you give me an idea where you’re going with this and the timeframe? If it’s something that you can supply straight away - like the missing library - or something simple that I can work around then I’ll expect to wrap it in a few days. If it’s entering a development cycle and you don’t expect a result for a couple of weeks or months, I’ll make other plans. Chris.
Currently, your issue is pending for analysis and is in the queue. Once we complete the analysis of your issue, we will then be able to provide you an estimate.
Has there been any progress on this? I’ve seen no notifications. Still hoping for a quick answer on whether this is a quick fix (you supply the missing library or help me identify a coding error) or requires development work. We upgraded to Aspose.Email.dll 220.127.116.11 specifically to get asynchronous sending to Exchange and this is a blocker for us.
We try our best to deal with every customer request in a timely fashion, we unfortunately cannot guarantee a delivery date to every customer issue. We work on issues on a first come, first served basis. We feel this is the fairest and most appropriate way to satisfy the needs of the majority of our customers.
We are working over your issue. Once we complete the analysis of your issue, we will then be able to provide you the ETA. Thanks for your patience.
Please check the attached working project using IAsyncEwsClient.SendAsync. Hope this helps you. ConsoleAppIAsyncEwsClient.zip (26.1 KB)
Regarding the question about Aspose.Email.XmlSerializers, could you please create a simple visual studio test project to reproduce this issue at our end? We will investigate this issue and provide you more information on it.
Thanks for the sample code. Yes indeed, that helped me resolve my asynchronous coding issue. I also discovered that the exception does not block creation of the Exchange email client, and can be ignored. It occurs during execution of EWSClient.GetEwsClientAsync deep in mscorlib. It is exposed in your project if you open Exception Settings and turn on Break When Throws for Common Language Runtime / System.IO.FileNotFoundException. Let’s close this issue.
Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Email, we will be happy to help you.