1
Answer

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

anjumathi kumar

anjumathi kumar

13y
1.6k
1
 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)