Exemple #1
0
        private void ServiceTimer_Tick(object sender, ElapsedEventArgs e)
        {
            string Msg = "Hi ! This is DailyMailSchedulerService mail.";//whatever msg u want to send write here.

            // Here you can write the
            ServiceLog.SendEmail("*****@*****.**", "", "", "Daily Report of DailyMailSchedulerService on " + DateTime.Now.ToString("dd-MMM-yyyy"), Msg);

            if (getCallType == 1)
            {
                timer1.Stop();
                System.Threading.Thread.Sleep(1000000);
                SetTimer();
            }
        }
Exemple #2
0
 protected override void OnStop()
 {
     timer1.AutoReset = false;
     timer1.Enabled   = false;
     ServiceLog.WriteErrorLog("Daily Reporting service stopped");
 }
Exemple #3
0
 protected override void OnStart(string[] args)
 {
     timer1.AutoReset = true;
     timer1.Enabled   = true;
     ServiceLog.WriteErrorLog("Daily Reporting service started");
 }