Forum Moderators: coopster

Message Too Old, No Replies

Multiple CCs in formmail

How?

         

Mokita

12:59 am on Nov 1, 2006 (gmt 0)

10+ Year Member



My form currently has an array that looks like this:

$formAction['default'] = array(
'recipient' => 'person1@example.com',
'recipient_cc' => 'person2@example.com',
'recipient_bcc' => 'person3@example.com',
'subject' => 'Contact Form',
'redirect' => 'http://www.example.com/thanks.html',
);

Can I make it successfully send to multiple CCs by changing that particular line to something like this?

'recipient_cc' => 'person2@example.com','person4@example.com',

OR maybe this:

'recipient_cc' => ('person2@example.com','person4@example.com')

TIA.

mcibor

3:17 pm on Nov 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Mokita!

Neither will work.

in the array you can associate only one value with one key.
However, the value can be anything (even an array), but disregard that for a moment.

In this example for recipient_cc you have to have a string = some text.

As you remember, if you want to send an email to more addresses separate them with a coma:

CC: person2@example.com, person4@example.com

So do that, but put the string in quotes:

$formAction['default'] = array(
'recipient' => 'person1@example.com',
'recipient_cc' => 'person2@example.com, person4@example.com',
'recipient_bcc' => 'person3@example.com',
'subject' => 'Contact Form',
'redirect' => 'http://www.example.com/thanks.html',
);

Hope this helps you
Michal

Mokita

8:47 pm on Nov 1, 2006 (gmt 0)

10+ Year Member



That helps enormously! Many thanks Michal :)