Skip to content
Snippets Groups Projects
Commit cbcec379 authored by lobo's avatar lobo
Browse files

Fix cc/bcc address merged with to address for Mail_mail class

parent 3a2f6ff5
Branches
Tags
No related merge requests found
......@@ -163,19 +163,21 @@ class CRM_Utils_Mail {
$headers = &$msg->headers($headers);
$to = array($params['toEmail']);
//get emails from headers, since these are
//combination of name and email addresses.
if (CRM_Utils_Array::value('Cc', $headers)) {
$to[] = CRM_Utils_Array::value('Cc', $headers);
}
if (CRM_Utils_Array::value('Bcc', $headers)) {
$to[] = CRM_Utils_Array::value('Bcc', $headers);
unset($headers['Bcc']);
$result = null;
$mailer =& CRM_Core_Config::getMailer( );
// Mail_smtp and Mail_sendmail mailers require Bcc anc Cc emails
// be included in both $to and $headers['Cc', 'Bcc']
if (get_class($mailer) != "Mail_mail") {
//get emails from headers, since these are
//combination of name and email addresses.
if ( CRM_Utils_Array::value( 'Cc', $headers ) ) {
$to[] = CRM_Utils_Array::value( 'Cc', $headers );
}
if ( CRM_Utils_Array::value( 'Bcc', $headers ) ) {
$to[] = CRM_Utils_Array::value( 'Bcc', $headers );
}
}
$result = NULL;
$mailer = CRM_Core_Config::getMailer();
if (is_object($mailer)) {
CRM_Core_Error::ignoreException();
$result = $mailer->send($to, $headers, $message);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment