How can I send an email to different addresses?

arunsasi 02 Jul, 2012
Hi All,

I am using CF 4.0. I am trying to create a from to send emails to each department based on drop down selection.

I followed the step mentioned in

http://www.chronoengine.com/faqs/2603-how-can-i-send-an-email-to-different-addresses.html

like this

<?php
$recipient = JRequest::getString('recipients', 'em1', 'post');
$emails = array (
'em1' => [email]'arun@gmail.com[/email]',
'em2' => [email]'arunsasi@india.com[/email]',
'em3' => [email]'admin@example.com[/email]' );
$form->data['email_to_use'] = $emails[$recipient];
?>


After implementing, all mail is going to only one email id.

Please help...
GreyHead 03 Jul, 2012
Hi arunsasi,

Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.

Note: if you are using the Easy Wizard you may need to switch to the Advanced Wizard to do this; if you want to continue to use the Easy Wizard please make a copy of your form first and add the Debugger action to the copy.

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