Hai guys, My website has thousands of users... I have implemented a background task of sending mails to every user once a day ... I followed this link to do this...
http://www.codeproject.com/KB/aspnet/ASPNETService.aspx
My question is will Application_Start() will be fired for every user hitting my website... If so every user will be receiving a n number of mails daily so i want to avoid it...
The Application_Start and Application_End methods are special methods that do not represent HttpApplication events. ASP.NET calls them once for the lifetime of the application domain, not for each HttpApplication instance.
So When first user will open the site it will hit the application_start method after that it will not.
I will add that what you are trying to do is risky. If you want to do batch email sending then you may want to think about Scheduler which can send emails daily.