Forums

Sending emails to multiple users on Dynamic To

ramugu 08 Mar, 2012
Hi,

I am new in this forum and I'm facing a situation with a form that I'm doing with Chronoform . (for reference my Joomla Version is 1.6 and Chronoforms 4.0 RC3.2).

My problem is the next: in my form I am using a Custom Element in which I select all registered user's emails addresses and names (from Joomla User's table) and display them into a list (select multiple), here is the code.



<?// Get a database object
		$db =& JFactory::getDBO();
		$query = "SELECT email , name FROM intra_users;";
		$db->setQuery($query);
		//$row = $db->loadRow();
		$row = $db->loadRowList();
?>

	<select multiple="multiple" size="5" class=" validate['required']" title="" name="txt_test[]">
	<?
		$i = 0;
		foreach ($row as $v1) { 
		?>
			<option value='<?print_r($row[$i][0]);?>'> <?print_r($row[$i][1]);?> </option>
			
			<?$i  ;
		}
	?>
	</select>


... so the result for this will look like:


<select multiple="multiple" size="5" class=" validate['required']" title="" name="txt_test[]">
	<option value='utest1@example.com'> User Test1 </option>
	<option value='utest2@example.com'> User Test2 </option>
	<option value='utest3@example.com'> User Test3 </option>
	<option value='utest4@example.com'> User Test4 </option>
</select>


All these work perfectly, what I want to do is to send an email to all users selected from the list, it is dynamic not only in the not only in the selected email but also in the number of selected users .

It works fine when I select only a single user, but when I select more than one I get this error:

Language string failed to load: invalid_address:

The field I am using in the Dynamic To stores these values:
[email]utest1@example.com[/email],utest2@example.com,utest3@example.com

How can I handle with this problem, It seems to be related with the comma separated emails that are not being accepted. I have read some other posts but no one work to me. Any help will be higly appreciated.
This topic is locked and no more replies can be posted.