Forums

Problem of send different mail

star 05 May, 2009
i having problem of sending to different email based on my option list.
Isn't chronoform provide this feasibility?
Anyone can help me? Thanks
star 05 May, 2009
here is my coding..

Form HTML:
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label">Option</label>
<select name="recipients[]" id="select_4" size="5" title="" multiple="multiple" id="teacher">
<option value="em1">General Product</option>
<option value="em2">Family Product</option>
<option value="em3">Customer Service</option>
<option value="em4">Privilege Cards</option>
<option value="em5">General Feedback</option>
</select>
</div>
<div>


on Submit Code:
<?php
$emails = array('em1' => [email]'fong@dnium.com[/email]', 'em2' => [email]'fong5@dnium.com[/email]', 'em3' => [email]'fong1@dnium.com[/email]', 'em4' => [email]'fong2@dnium.com[/email]', 'em5' => [email]'fong3@dnium.com[/email]');
$em_array= array();
$rows[0]->extraemail .= ", ".$emails[$_POST[recipients]];
?>



anything that i made wrongly? because i cannot sent the mail to the selected dropdown.
PLease guide me, thank
GreyHead 05 May, 2009
Hi star,

Which version of ChronoForms do you have, the code for this has changed several times in different versions.

I think that the FAQ has the correct code for the latest release and several others.

Bob
star 05 May, 2009
i am using version 1.5
i already go through the previous forum. i tried to follow up the way, but i still cant solve my problem.
is there anything that i miss up?
GreyHead 05 May, 2009
Hi star,

The FAQ has this example for the latest releases
<?php
$MyForm =& CFChronoForm::getInstance('form_name_here');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$MyFormEmails->setEmailData(1, 'to', $emails_2[$_POST['recipients']]);
?> 

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