Adding CC field in Drupal_mail function doesn't support in Drupal 6.x
tomsteve - June 9, 2009 - 11:35
| Project: | Mail API |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hai,
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.
Thanks
TomSteve

#1
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.