Email: Fix handling multiple recipients

This commit is contained in:
Benjamin Renard 2024-02-19 20:28:55 +01:00
parent 4907442122
commit fb67ffdf3b
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC

View file

@ -125,9 +125,7 @@ class Email {
$headers["To"] = $to; $headers["To"] = $to;
$to = array ( $to = ensure_is_array($to);
'To' => $to
);
foreach(array_keys($headers) as $header) { foreach(array_keys($headers) as $header) {
if(in_array(strtoupper($header), array('BCC', 'CC'))) { if(in_array(strtoupper($header), array('BCC', 'CC'))) {
@ -144,7 +142,7 @@ class Email {
unset($headers[$header]); unset($headers[$header]);
continue; continue;
} }
$to[strtoupper($header)] = $headers[$header]; $to = array_merge($to, $headers[$header]);
} }
} }