The recordset works correctly as I have echoed it out on the page. The issue seems to be with the form post. Once I submit the form the recordset values disappear.
If I echo the recordset value into a form variable array and then use that value to send the email, the email send ok.
<input name="ClientEmail" type="hidden" id="ClientEmail" value="<?php echo($client2->getColumnVal("Email")); ?>">
$RecipArray[$CurIndex ] = "".((isset($_POST["ClientEmail"]))?implode(",",$_POST["ClientEmail"]):"") ."";
However all the email address are sent in the "To" field so all the recipients can see all the email address the email is being sent to.
I could add the to the "bcc" field but I still need an email address to put in the "to" field.
Is there a way to stop the recordset values disappearing when the form is submitted or can I somehow use the form variable to send to recipient individually rather than all in the "To" field?