I have an old customer email list (about 1100 emails) and I would like to email them all. This list is in a gigantic php array.
I am using sendgrid and they have a nice php howto located here: http://sendgrid.com/documentation/display/api/SMTPPHPExample
I am using their code and in one section they have:
$toList = array('[email protected]', '[email protected]');
Now, to not overflow sendgrids servers or get caught in spam filters I would like to only send batches of 100 emails at a time, how can I grab 100 emails from my big array, put them into this array, run through the sendgrid login, send email, then go back, grab the next 100 and run the loop again.
I'm not too php savvy so i have no idea how to set up this loop.
Thanks a lot for any help!!
I think you're talking about array array_chunk ( array $input , int $size[, bool $preserve_keys = false ] ). It splits an array into and array of smaller arrays based off of the value in $size.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With