diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 4d7da8fe848..0a9f799e8a7 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -398,7 +398,7 @@ class CMailFile $replacecc = false; $tabcc = explode(',', $addr_cc); foreach ($tabcc as $key => $cc) { - if (in_array($cc, $tabcc)) { + if (in_array($cc, $listofemailstonotsendto)) { unset($tabcc[$key]); $replacecc = true; } @@ -412,7 +412,7 @@ class CMailFile $replacebcc = false; $tabbcc = explode(',', $addr_bcc); foreach ($tabbcc as $key => $bcc) { - if (in_array($bcc, $tabbcc)) { + if (in_array($bcc, $listofemailstonotsendto)) { unset($tabbcc[$key]); $replacebcc = true; }