Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a function written inside session start event for sending mails.For the first user of the day it sends mail and makes a flag=true in database.The next time for the new user or the same user it checks for the flag, if its true It doesn't send mails.This is how I want the function to perform.In simple words I want my web app to send a mail daily if I am the first user in current date. But I think its not firing everyday.If it fires everyday and my function is working fine then I should get mail everyday.I get mails after 2 or 3 days. Why so ? Should the function be written in session start itself? Any ideas or suggestions are welcome.

session start event:-
protected void Session_start()
{
 try
{
  //code to check if flag is true for today's date
  if(flag != true)
  {
    //get data from database and sent it in mail.
    //insert flag=true for current date
  }
}
 catch()
 {
 }
}
Posted
Updated 18-Sep-14 23:44pm
v2
Comments
Prasad Avunoori 19-Sep-14 3:20am    
Does your Application have login facility?
pwavell 19-Sep-14 5:02am    
yes.But before login page displays i want my mails to be delivered.Its working fine on local machine when i debug and see.but after publishing its not working properly.
ZurdoDev 19-Sep-14 7:34am    
My guess is there is some issue with how you're doing your flag.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900