How to limit to 100 emails per hour using php?
Most email providers such as Mailgun have a limit on sending emails (100 emails per hour)
Has the user base and there is a need to do the newsletter.
As better and more correct to implement a metered mailing list? Through the crowns and in the database to do the queue distribution? Or is there other options?
2 answers
Most of ratelimited usually works through the base -
when sending checks the number sent in the last hour-if not exceeded - are sent and incremented number, if the current hour != what time is it in the database to reset the counter and record.
you also need to decide what to do if the limit is exceeded (don't send just to queue and what to do if the queue is growing all the time)
Find more questions by tags E-mailBackendPHPMail server