0

I've been looking at usage of SendMailAsync to get Async emails in my ASP.NET MVC C# website in non-async methods, but I'm unclear whether this actually sends async when inside a non-async method ... or if there's a way to send it Async in a non-async method and have it work at scale if you're frequently sending emails.

smtpclient.SendMailAsync(message);
Keith Adler
  • 20,880
  • 28
  • 119
  • 189
  • 1
    Does this answer your question? https://stackoverflow.com/questions/12402681/is-it-possible-to-call-an-awaitable-method-in-a-non-async-method – Slack Groverglow Sep 17 '22 at 04:53
  • 1
    Does this answer your question? [How to call asynchronous method from synchronous method in C#?](https://stackoverflow.com/questions/9343594/how-to-call-asynchronous-method-from-synchronous-method-in-c) – Charlieface Sep 18 '22 at 01:57
  • 1
    Don't do this, it can lead to all kinds of problems. Instead, make the calling function async also. – Charlieface Sep 18 '22 at 01:57

0 Answers0