I'd like the ability to CC and BCC webform submissions to people rather than having all recipients appear in the email "To" header. (A client requested this functionality the other day.) Thanks. :)

Comments

quicksketch’s picture

By using conditional e-mail recipients, each user will receive an e-mail individually, is this not suitable enough?

TravisCarden’s picture

That would suffice, except that it requires every email address to be supplied as a form component. But in the case of my client, for example, they want the CEO to receive the email and the webmaster to be CC'ed, and neither one of those addresses comes from a form component. Does that make sense?

quicksketch’s picture

Status: Active » Closed (duplicate)

You could easily add them as recipients by creating hidden fields and then using those. Otherwise this will be implemented in #277581: Send emails with a custom/templated body (and subject, to addresses and from addresses).

anishvinoj’s picture

Try this way it will work

In your module folder you can find "webform.module" ,find the function theme_mail_headers in it
and add the cc as well as bcc in it under "$headers = array("

'CC' => 'xx@yyyy.com, xx1@yyyy1.com, xx2@yyyy2.com'
=>in this e.g i have mentioned how to add more cc's
like the same bcc can also be added

its working for me

if you find any alternative method for adding cc and bcc , please let me know

Regards,
Anish

bubsy119’s picture

Not working for me, does anyone have another solution ?

function theme_webform_mail_headers($form_values, $node, $sid, $cid) {
$headers = array(
'X-Mailer' => 'Drupal Webform (PHP/'. phpversion() .')',
'CC' => 'my@email.com'
);
return $headers;
}