Send mail at certain times

 

Does anyone know how I could send email alerts at certain times?

I am looking to do this every hour, the Sendmail function is easy enough but I'm stuck on a Time loop? 

 Thank you in advance 

 

Lots of ways. Here is one:

int OnInit()
  {
   EventSetTimer(1);
   return(INIT_SUCCEEDED);
  }

.....

void OnTimer()
  {
   static int LastHour=-1;
   int ThisHour=TimeHour(TimeLocal());
   if(ThisHour!=LastHour)
     {
      SendMail("My Subject","My Message");
      LastHour=ThisHour;
     }
  }
 
Check the current time vs the last sent time; no loop required.
 
Great thanks