According to RFC5322 (which obsoletes RFC2822), Section 3.6.3 (http://tools.ietf.org/html/rfc5322#section-3.6.3), the correct format for destination address fields are "To:", "Cc:", and "Bcc:".

The PHPMailer module does not correctly match those header fields when processing e-mails, and therefore, incorrectly puts recipients specified in those fields into a "CustomHeader" field, and never sends the message to those recipients.

The attached patches corrects that behavior for the 6.x-2.x and 6.x-3.x versions.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Title: The Cc and Bcc destination address fields are not the correct case . . . » The Cc and Bcc destination address fields are not the correct case
Status: Active » Reviewed & tested by the community

This looks very very correct. No idea why the existing code is using all-uppercase keys. I've grepped through Drupal core and couldn't find a single instance of /'cc'/i anywhere, so all that prevents me from committing this patch is that I do not know whether any other code in Drupal is using those all-uppercase tags (in which case we'd have to care for both formats).

However, since there is not a single instance of 'Cc' in core, this can also only mean that we're passing mail header values directly to the responsible mail system/engine, which in turn means that we should follow the RFC here.

Marking RTBC to see whether @smk-ka has any objections.

sun’s picture

Title: The Cc and Bcc destination address fields are not the correct case » Bogus case of Cc and Bcc mail header fields
Status: Reviewed & tested by the community » Fixed

MimeMail is also using the properly capitalized keys:

  if ($cc) $params['headers']['Cc'] = $cc;
  if ($bcc) $params['headers']['Bcc'] = $bcc;

so...

Thanks for reporting, reviewing, and testing! Committed to 7.x-3.x and 6.x-3.x.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

bendiy’s picture

Can't BCC without this patch. It hasn't made it into the recommended releases yet, just dev.

chinita7’s picture

I patched it to 3.1 version and it works. Thanks @oadaeh. I have tried also the latest dev version but didn't send Bcc without the patch.