CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail »
  • Using CiviSMTP (Moderator: shane) »
  • BCC not working after switch to CiviSMTP
Pages: [1]

Author Topic: BCC not working after switch to CiviSMTP  (Read 1289 times)

pantheon

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 3.4.4
  • CMS version: Drupal 6.26
  • MySQL version: 5.5
  • PHP version: 5.3
BCC not working after switch to CiviSMTP
May 08, 2013, 03:22:38 am
Hi,
One of our clients (forces4quality) has a customized single site installation of CiviCRM 3.4.4 and Drupal 6.26. Using hook_civicrm_alterMailParams we added 2 BCC email addresses to all outgoing emails through CiviCRM. It was working as intended until client switched to CiviSMTP.

Now the BCC email addresses are not getting any mail copies. We have the same codebase and database running in the staging site except it is not using CiviSMTP. The staging site BCC is working fine.

We added some logging and found this header. It is the value of $textHeaders in civicrm/packages/Mail/smtp.php just before sending the mail to CiviSMTP.


Text:MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="=_14a7772581488d8e7cc4be4d6361dc0e"
From: "AF4Q Web Team"
To: Alex Brown
Cc:
Bcc: f*****gmailcom, c***forces4qualityorg
Subject: Event Registration Confirmation Email
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Return-Path:
Reply-To: e*****forces4qualityorg
Date: Tue, 07 May 2013 06:26:30 -0400

As you can see above, the header contains the BCC email addresses, but they never get the mail copy.

We found a similar thread in the forum titled "CiviSMTP and e-mail Bcc for contribution receipts" (can't post link as it says I'm not allowed) but that seemed to resolve automatically. We are confused why this installation is behaving in this manner.

Thanks in advance for any help and suggestion.

alleyla

  • I post occasionally
  • **
  • Posts: 98
  • Karma: 1
  • CiviCRM version: 4.0.4
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.2
Re: BCC not working after switch to CiviSMTP
May 08, 2013, 04:06:30 am
We are looking into this, will keep you posted.

-Leyla / CiviSMTP Support

alleyla

  • I post occasionally
  • **
  • Posts: 98
  • Karma: 1
  • CiviCRM version: 4.0.4
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.2
Re: BCC not working after switch to CiviSMTP
May 08, 2013, 04:14:35 am
please email us the exact bcc addresses that didn't receive the emails as well as timezone for the timestamp you provided to support@civismtp.com

Thank you,

-Leyla
« Last Edit: May 08, 2013, 04:18:42 am by alleyla »

pantheon

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 3.4.4
  • CMS version: Drupal 6.26
  • MySQL version: 5.5
  • PHP version: 5.3
Re: BCC not working after switch to CiviSMTP
May 09, 2013, 02:17:40 am
Thanks for your reply. We have sent the information from the registered email address in the forum. Please do let us know if anything else is needed.

alleyla

  • I post occasionally
  • **
  • Posts: 98
  • Karma: 1
  • CiviCRM version: 4.0.4
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.2
Re: BCC not working after switch to CiviSMTP
May 15, 2013, 11:25:31 am
Hello,

Sorry for a delay on this.

In the current form the Bcc won't go through our service as we do not allow Bcc's in the header.

We do however support the way CiviCRM implements Bcc's for example for contribution pages where each Bcc is considered as a separate recipient and is sent a separate email with Bcc header removed.

You can change your plugin to do it the same way - see CRM_Utils_Mail::send function for an example (depending on your version) on how you can change your plugin code.

The code in CiviCRM depending on the version is something like this:

Code: [Select]
        $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 = $mailer->send($to, $headers, $message);

The $to parameter above for the $mailer->send function is an array that includes the recipient's email address as well as cc's and bcc's. As you can see from the code above the Bcc header is removed.

Email us or post here  if you have further questions.

Kind regards,

-Leyla
support@civismtp.com

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail »
  • Using CiviSMTP (Moderator: shane) »
  • BCC not working after switch to CiviSMTP

This forum was archived on 2017-11-26.