Answers.Body: <p>Yes, it's a bug, which is now fixed: <a href="https://issues.civicrm.org/jira/browse/CRM-19173" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-19173</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-11T16:19:12.103Z
Answers.LastActivityDate: 2016-08-11T16:19:12.103Z
Answers.UserDisplayName: TwoMice
Body: <p>If a contribution page is configured to Bcc receipts to a given address, the Bcc should not be included in emails to any recipient of that receipt.</p>
  
  <p>In my CiviCRM 4.7.9 site, the Bcc header is correctly not included in any receipt emails, if mail is sent with mail(), i.e., if "mail()" is selected at /civicrm/admin/setting/smtp.</p>
  
  <p>However, it IS visible in the email to the donor, if mail is sent with SMTP, i.e., if "SMTP" is selected at /civicrm/admin/setting/smtp.  </p>
  
  <p>FWIW, the SMTP provider in this case is sendgrid, but I'm not sure yet whether that's relevant.</p>
  
  <p>Is this a bug in CiviCRM, or is it an issue with Sendgrid?</p>
  
  <p><strong>Update:</strong>
  A code change as shown here causes Bcc to behave properly in SMTP (sendgrid) and mail(). Makes me think it's a bug that could be fixed in core.</p>
  
  <pre><code>diff --git a/CRM/Utils/Mail.php b/CRM/Utils/Mail.php
  index 57453a0..be3f052 100644
  --- a/CRM/Utils/Mail.php
  +++ b/CRM/Utils/Mail.php
  @@ -267,6 +267,7 @@ class CRM_Utils_Mail {
         }
         if (!empty($headers['Bcc'])) {
           $to[] = CRM_Utils_Array::value('Bcc', $headers);
  +        unset($headers['Bcc']);
         }
       }
       if (is_object($mailer)) {
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-11T15:39:55.263Z
Comments.Text: Sounds like a bug to me!
Comments.UserDisplayName: Parvez Saleh
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-11T16:20:00.293Z
Comments.Text: Right. Probably could have researched it just a tad more before posting. Thanks @ParvezSaleh
Comments.UserDisplayName: TwoMice
Tags: <issues>
Title: Bcc not hidden on mail sent by SMTP - is this a bug?
ThreadText: # Bcc not hidden on mail sent by SMTP - is this a bug?
  
  (Asked by: username_0 on 2016-08-03)
  
  If a contribution page is configured to Bcc receipts to a given address, the Bcc should not be included in emails to any recipient of that receipt.
  
  In my CiviCRM 4.7.9 site, the Bcc header is correctly not included in any receipt emails, if mail is sent with mail(), i.e., if "mail()" is selected at /civicrm/admin/setting/smtp.
  
  However, it IS visible in the email to the donor, if mail is sent with SMTP, i.e., if "SMTP" is selected at /civicrm/admin/setting/smtp.
  
  FWIW, the SMTP provider in this case is sendgrid, but I'm not sure yet whether that's relevant.
  
  Is this a bug in CiviCRM, or is it an issue with Sendgrid?
  
  **Update:**
  A code change as shown here causes Bcc to behave properly in SMTP (sendgrid) and mail(). Makes me think it's a bug that could be fixed in core.
  
  ```
  diff --git a/CRM/Utils/Mail.php b/CRM/Utils/Mail.php
  index 57453a0..be3f052 100644
  --- a/CRM/Utils/Mail.php
  +++ b/CRM/Utils/Mail.php
  @@ -267,6 +267,7 @@ class CRM_Utils_Mail {
         }
         if (!empty($headers['Bcc'])) {
           $to[] = CRM_Utils_Array::value('Bcc', $headers);
  +        unset($headers['Bcc']);
         }
       }
       if (is_object($mailer)) {
  
  ```
  
  **Tags:** issues
  
  > **Comments:**
  > **username_1**: Sounds like a bug to me!  
  > **username_0**: Right. Probably could have researched it just a tad more before posting. Thanks @username_1  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-08-11. Score: 2 | Accepted answer
  
  Yes, it's a bug, which is now fixed: <https://issues.civicrm.org/jira/browse/CRM-19173>
  
  
  ---
  
  