break up array into little arrays

前端 未结 6 753
南方客
南方客 2021-01-20 06:03

i am sending out email to a list of people. I have the list of recipients in array but the list can get up to 500 people. There is a limitation on the number of recipients

6条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-20 06:21

    I would simply iterate over the complete array, building up the recipients string, then sending out an email when the limit is reached, then resetting the string and continuing on with the iteration until the next limit event or until the end of the array is reached.

提交回复
热议问题