I am new to Drupal.I want to implement the mailing function in drupal which must include "CC" field.

I came to know that drupal 6.x doesn't support adding CC filed in drupal_mail function.Can anyone please provide me a solution for this.



guysaban’s picture

Hi Steve,

I am no expert on the subject - I have fiddled a little with the drupal_mail function. In the API notes there is a mention of a headers argument (type array) which can be used for adding a cc to the outgoing email.

$headers['CC'] = $email_address_list

Where you would need to create $email_address_list that contains a list of the email address for the cc.

The header array in the drupal_mail code is:
$headers = array(
'MIME-Version' => '1.0',
'Content-Type' => 'text/plain; charset=UTF-8; format=flowed; delsp=yes',
'Content-Transfer-Encoding' => '8Bit',
'X-Mailer' => 'Drupal'

So you are essentially adding on the CC element to $headers. I am sure there are better ways of doing this.

adamtyoung’s picture

Adding the headers['CC'] doesn't seem to work.

adamtyoung’s picture

This worked for me:

function mymodule_mail($key, &$message, $params) {
$message['headers']['CC'] = "myemail@me.com";