How to make a script run automatically?

Asked

Viewed 1,419 times

3

I’m making a script for sending of emails to subscribers, as a newsletter, but I need it to run automatically and this execution is hourly.

As my operating system is the Windows and initially want to test this script locally, I searched and saw that should be scheduled a task that would make the execution of this script, but I have no idea how to do it.

Besides, I must make every hour script send 100 emails, that is, if there are 300 subscribers, in the first hour the script will send 100 emails and its execution will be interrupted, in the second hour the execution is resumed and sent another 100 emails and so on, until all subscribers receive the emails.

So far I’ve been able to send everyone, but I’m not getting this control of the emails sent by the hour, I would like you to help me, giving a hint or idea of how to do it.

Thanks

  • Wouldn’t that be the case with a flag? send 100 and mark as sent + send 100 and mark as sent, at the end of all shipments the flag is reset for the next shipment

1 answer

3


To send in 100 out of 100 you will have to program this in the script you use, to select 100 records. In windows I do not know how to do this, but I recommend you to use Linux (Hosting) and use the CRON option you have in Phpmyadmin. There you will program in how many hours you want to send and you should put the path to the file you should run, eg: /home/public_html/files/file.php

Browser other questions tagged

You are not signed in. Login or sign up in order to post.