What are the risks involved in sending multiple emails to individual recipients in a loop to avoid spam filters?

Sending multiple emails to individual recipients in a loop to avoid spam filters can lead to your emails being flagged as spam by email providers. To avoid this, you can use a delay between sending each email to mimic human behavior and prevent triggering spam filters.

// Set a delay between sending each email
$delay = 5; // in seconds

$recipients = ['recipient1@example.com', 'recipient2@example.com', 'recipient3@example.com'];

foreach ($recipients as $recipient) {
    // Send email code here
    
    // Delay before sending the next email
    sleep($delay);
}