From e4c75084caebd1a9803bd31203267b2e5f6731dc Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 10 Feb 2020 17:52:41 -0800 Subject: [PATCH] CRM_Utils_Mail::send - Adjust hack to work with filtered mailer --- CRM/Utils/Mail.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/Mail.php b/CRM/Utils/Mail.php index 02dc32cd31..696ed860d2 100644 --- a/CRM/Utils/Mail.php +++ b/CRM/Utils/Mail.php @@ -279,7 +279,10 @@ class CRM_Utils_Mail { // * All other mailers require that all be recipients be listed in the $to array AND that // the Bcc must not be present in $header as otherwise it will be shown to all recipients // ref: https://pear.php.net/bugs/bug.php?id=8047, full thread and answer [2011-04-19 20:48 UTC] - if (get_class($mailer) != "Mail_mail") { + // TODO: Refactor this quirk-handler as another filter in FilteredPearMailer. But that would merit review of impact on universe. + $driver = ($mailer instanceof CRM_Utils_Mail_FilteredPearMailer) ? $mailer->getDriver() : NULL; + $isPhpMail = (get_class($mailer) === "Mail_mail" || $driver === 'mail'); + if (!$isPhpMail) { // get emails from headers, since these are // combination of name and email addresses. if (!empty($headers['Cc'])) { -- 2.25.1