ASP.NET MVC:使用SendAsync(System.Net.Mail)发送电子邮件 [英] ASP.NET MVC: Send email using SendAsync (System.Net.Mail)

查看:644
本文介绍了ASP.NET MVC:使用SendAsync(System.Net.Mail)发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么办法的在MVC 以获得System.Net.Mail SendAsync工作,而不是阻塞发送方法是什么?

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

我尝试使用它,但打出了页开始异步操作必须具有异步属性的错误,我显然无法解析(或可以吗?),因为与@Page指令在没有ASPX页面我可以添加异步属性。

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.

帮助是极大的AP preciated:(

Help is greatly appreciated :(

推荐答案

它看起来像你想 ASP.NET MVC的异步支持。另请参见<一个href=\"http://weblogs.asp.net/jeffreyzhao/archive/2009/01/30/extend-asp-net-mvc-for-asynchronous-action.aspx\"相对=nofollow>扩展ASP.NET MVC的异步操作。

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

<一个href=\"http://stackoverflow.com/questions/275545/does-asp-net-mvc-framework-support-asynchronous-page-execution\">This SO问题也有关。

这篇关于ASP.NET MVC:使用SendAsync(System.Net.Mail)发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆