We’re working on a multiplatform application and we have a common library that is reused across all our platforms. We need to be able to send email via Office365, so we’re using microsoft’s MSAL library to authenticate and get tokens
The problem we’re facing is that the Aspose library does not support the Async pattern in any of the email client options. There’s no option to call “await SendAsync(…)” for email. Specifically, our main issue at the moment is that the ITokenProvider interface does not have any async friendly methods. All samples online suggest to use AcquireToken() and then calling “.Result”. This is a bad practice and it is causing a deadlock when we try to send email.
We’ve worked around this by getting the access token before trying to send email, but we really need a way to send Email asynchronously so that we can use the latest .net features and take advantage of the async pattern and existing libraries that use that pattern to obtain tokens. As an added bonus this allows to send emails seamlessly without blocking the UI thread.