Cut sending mails to differ

Is there a way with CFMAIL to differ a mailing list in several launch.
I mean, the server send 400 mails to notify members of a new ad.
But the host limit the mail sending to 150 per minutes, then it stops the rest.
So, as it is per alphabetic order, the 150 first member recieve the mail, and the rest of members , no.
So, I should send 120 first mail, then 120 next in 2 minutes later, end 120 next in 4 minutes later, and so on …
Is there any code to do that in a simple way ?
Thanks for any help.
Pierre.

Don’t forget to tell us about your stack!

OS: ???
Java Version: ???
Tomcat Version: ???
Lucee Version: ???

It would be better to use a dedicated SMTP service, a virtual SMTP doesn’t cost much.
Alternatively you could use cfsleep every 120 messages to pause the loop, but frankly it doesn’t seem like a good solution to me.

1 Like

You could query your mailinglist for total number of records, and then by record id, email the first 100, then an hour later email the second 100, so on and so forth.

Or a scheduled task running every 5 minutes, sending 150 mails at a time. When sending the emails, include a mailsent-column or such a thing, and then adjust the query to get the data to NOT include all records where mailsent has a value.

Thanks for all answers,
At the time, the hosting reauthorize 400 mail outgoing at a time,
So the problem, does not exist anymore for the moment,
But it can come back, if the host change their parameters outgoing, or if the list of user go up fast.

file a bug, I think it’s a good idea to be able to throttle the mail spooler to x messages per minute

do the emails get accepted by the server and dropped or are they put into the lucee mail spooler retry queue?

does it return a 429: Too many messages error?