You'll need something like the following (maybe-working example code) using get_users();
:
$users = get_users( /* receive array ofAdd useryour objectsargs here */ );
foreach ( $users as $user )
{
$user_email_addresses[] = $user->email; // receive array of user mail addresses here
}
function wpse28212_send_delayed_bulkmail( $email_addresses )
{
$i = 0;
foreach ( $user_email_addresses as $email_addy )
{
++$i; // count users up
$delay = 0; // in miliseconds (ms)
if ( $i >= 500 )
{
$delay = 3600000; // 1 hour
}
sleep( $delay );
wp_mail( $email_addy, 'subject', 'message' );
}
}
Links:
wp_mail();
sleep();
usleep();
// alternate tosleep();