I have an array of email addresses I am sending emails to.
I would like to sort them by alternating domain names, so if I have 30 @gmail.com, 30 @yahoo.com and 30 @aol.com, the sort would result in a @gmail.com, then @yahoo.com, then @aol.com, then @gmail.com again, etc.
The sort would alternate as much as possible so that there would be as few identical domain names in a row.
Why: To prevent being considered as a source of spam, its best to "throttle" email sending, or sleep between each send so mail servers are not hit quickly many times in a short time spam. Instead, I would like to do that above to create a lag between times an email provider is hit by me, but without stopping my script and causing a delay to my end user.