Answer the question
In order to leave comments, you need to log in
How to limit 100 emails per hour via php?
Most mail services such as Mailgun have a limit on sending emails (100 emails per hour).
There is a user base and there is a need to do a newsletter.
What is the best and most correct way to implement metered mailing? Do mailing queues through cron and database? Or are there other options?
Answer the question
In order to leave comments, you need to log in
It can be so. And you can set up a local postfix with sending limits
https://wiki.deimos.fr/Postfix:_limit_outgoing_mai...
Most of the ratelimits usually work through the database -
when sending, the number of those sent in the last hour is checked, if there is no excess, we send and increment the number, if the current hour != hour in the database, reset the counter and write it down.
you also need to decide what to do if the limit is exceeded (do not send at all, put in a queue and what to do if the queue is growing all the time)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question