Active
Project:
Mail API
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Jun 2009 at 11:35 UTC
Updated:
27 Aug 2010 at 20:22 UTC
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
Comments
Comment #1
guysaban commentedHi 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.
Comment #2
adamtyoung commentedAdding the headers['CC'] doesn't seem to work.
Comment #3
adamtyoung commentedThis worked for me: