From fb67ffdf3baf99114a4fc3f22f3264c3fa783a2e Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 19 Feb 2024 20:28:55 +0100 Subject: [PATCH] Email: Fix handling multiple recipients --- src/Email.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Email.php b/src/Email.php index 942443b..75941b0 100644 --- a/src/Email.php +++ b/src/Email.php @@ -125,9 +125,7 @@ class Email { $headers["To"] = $to; - $to = array ( - 'To' => $to - ); + $to = ensure_is_array($to); foreach(array_keys($headers) as $header) { if(in_array(strtoupper($header), array('BCC', 'CC'))) { @@ -144,7 +142,7 @@ class Email { unset($headers[$header]); continue; } - $to[strtoupper($header)] = $headers[$header]; + $to = array_merge($to, $headers[$header]); } }