Search code examples
model-view-controllerasynchronoussendasync

ASP.NET MVC: Send email using SendAsync (System.Net.Mail)


is there any way in MVC to get the System.Net.Mail SendAsync to work, instead of the blocking Send method?

I tried using it but hit the "Page starting an asynchronous operation has to have the Async attribute" error, which I obviously can't resolve (or can I?) because there is no ASPX page with an @Page directive where I could add the Async attribute.

Help is greatly appreciated :(


Solution

  • It looks like you want Asynchronous support for ASP.NET MVC. See also "Extend ASP.NET MVC for Asynchronous Action".

    This SO question is also relevant.