anjumathi kumar

anjumathi kumar

  • NA
  • 54
  • 49.4k

how to use timer tick event for sending mail on particular date

Sep 14 2011 1:26 AM
 public void emailsenddatetimeevent(DateTime emailsenddate)
    {
       


        System.Timers.Timer time = new System.Timers.Timer();
        string TodayDatetime = DateTime.Now.ToLongTimeString();
        time.Start();
        time.Interval = 600000;

        //double interval = 0;
        //if (emailsenddate > DateTime.Now)
        //{
        //    TimeSpan span = emailsenddate - DateTime.Now;
        //    interval = span.TotalMilliseconds;
        //}
        if (DateTime.Now == emailsenddate)
            emailSend();
    }

Hi this is my function for sending mail on particular date..till that i want to check every time using timer..i dono the coding for exactly...i tried the code that oly posted..i have my date in emaildate in the date my emailsend function want to send mail anybody know this? please reply as soon as possible..say what i want to add and how to change

Answers (1)