Hi!
I need help with sending mail according to selected checkboxes:
My form code:
And on submit code:
It all works fine, but e-mail are being sent to values of checkboxes (north, middle1...) instead of [email]north@email.com[/email], [email]middle1@email.com[/email]...
here is debug
What am i doing wrong?
I need help with sending mail according to selected checkboxes:
My form code:
<div class="form_item">
<div class="form_element cf_checkbox">
<label class="cf_label" style="width: 150px;">(*) Please select prefered sailing area:</label>
<div class="float_left">
<input type="checkbox" name="recipients[]" value="north" id="check00" />North Adriatic<br />
<input type="checkbox" name="recipients[]" value="middle1" id="check01" />Middle Adriatic (Zadar area) <br />
<input type="checkbox" name="recipients[]" value="middle2" id="check02" />Middle Adriatic (Sibenik area) <br />
<input type="checkbox" name="recipients[]" value="middle3" id="check03" />Middle Adriatic (Split area) <br />
<input type="checkbox" name="recipients[]" value="south" id="check04" />South Adriatic <br />
</div>
And on submit code:
<?php
$emails_2 = array(
'north'=>'north@email.com',
'middle1'=>'middle1@email.com',
'middle2'=>'middle2@email.com',
'middle3'=>'middle3@email.com',
'south'=>'south@email.com',
$MyForm =& CFChronoForm::getInstance('Send_enquiry2');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$MyFormEmails->setEmailData(1, 'to', $emails_2[$_POST['recipients']]);
?>
It all works fine, but e-mail are being sent to values of checkboxes (north, middle1...) instead of [email]north@email.com[/email], [email]middle1@email.com[/email]...
here is debug
Form passed first SPAM check OK
Form passed the submissions limit (if enabled) OK
Form passed the Image verification (if enabled) OK
Form passed the server side validation (if enabled) OK
$_POST Array: Array ( [Name_Surname] => AAA [State_Country] => AAA[e-mail] => test@mail.com [Phone] => [recipients] => Array ( [0] => north [1] => middle1 [2] => middle2 ) [chrono_verification] => x6hb9 [button_14] => Submit [1d910df29cde412c0fc62634efbbff1e] => 1 [1cf1] => 9ea296f8f2bfccf5a307ef56ce397b03 [chronoformname] => Send_enquiry2 )
$_FILES Array: Array ( )
Form passed the plugins step (if enabled) OK
An email has been SENT successfully from (System)system@mail.com to info@mail.com,north, middle1, middle2
An email has been SENT successfully from (Admin)admin@mail.com to dkulot@gmail.com
Debug End
What am i doing wrong?