Search code examples
c#asp.networkflowreminders

Starting with reminders trought ASP.net


I need to check daily if there is some people late on there task, and send them emails if they are... what do i choose ? none of these seem made for that.

enter image description here


Solution

  • I used a background process, it's a thread that launch the function that sends reminder emails if necessary, then sleeps for 24h, hope it's good.

    In Global.asax :

    public class Global : System.Web.HttpApplication
    {
        protected void Application_Start(object sender, EventArgs e)
        {
            Thread backGroundProcess = new Thread(BoucleInfini);
            backGroundProcess.Start();
        }
    }
    

    The thread :

        protected void BoucleInfini()
        {
            while (0==0)
            {
                BLL.Rappel.RetardCheckUp(System.Web.Hosting.HostingEnvironment.MapPath("~/_inc/courriels"));
    
                Thread.Sleep(1000 * 60 * 60 * 24);
            }
        }
    

    Using web site mason gave me : http://www.hanselman.com/blog/HowToRunBackgroundTasksInASPNET.aspx

    EDIT

    This is wrong...

    Just use windows task scheduler, it's on almost every windows servers.