16
2012
04

Asp.Net 如何定时发送邮件

一般邮件定时发送是使用Winform来实现比较简单,但在 ASP.NET中也可以使用计时器(Timer)完成一些定时动作。做一个winform 来定时发邮件。然后通过windows计划任务,设置为指定时间,每次自动运行,运行完毕后自动关闭。而Asp.net中也使用Timer 设定间隔多长时间执行发送事件
  protected void Application_Start(Object sender, EventArgs e)
  {
  Timer t = new Timer(60000);//设计时间间隔,如果一个小时执行一次就改为3600000 ,这里一分钟调用一次
...
«1»