Forums

Problem sending to multiple recipient with new CF

Mushr00m 15 May, 2012
In the new CF version (4) when we want to send the form to multiple recipient from a dropdown form choise, we have to do this :
$adresses = JRequest::getString('input_mail', '', 'post');
$emails1 = array (
"ans1" => "address1@gmail.com",
"ans2" => "address2@hotmail.fr"
);
$emails2 = array (
"ans1" => "address3@gmail.com"
);
$form->data['Email1'] = $emails1[$addresses];
$form->data['Email2'] = $emails2[$addresses];


In a past version is was more simple because we could do this :
$emails = array (
"ans1" => "address1@gmail.com,address3@gmail.com",
"ans2" => "address2@hotmail.fr"
);


So the difference is to be able ta add more than One address in each case in the array. Why it's not still this way ? Because in my case for some value on the dropdown I have 3 recipients and for other just 1, so it's painfull to add all this array and I don't understand why the first version doesn't work ?

More strange if I try with the old technic on the new CF, I still have the message in debug mode "Result An email has been SENT successfully from....HERE MY 2 ADDRESSES" but no mail arrive...

Thanks for the help ;-)
GreyHead 16 May, 2012
Hi Mushr00m,

I'm pretty sure that a lot of the code in CFv4 was re-written from scratch and so some of it behaves differently.

There have been a couple of other threads about multiple addresses and I updated my Email [GH] action to handle this and added an option to send individual emails if there are multiple To Email addresses.

Bob
This topic is locked and no more replies can be posted.