thanks for the reply, but it only returns a comma... maybe because there is more than one comma in the variable?
see, here is how it looks before we strip that last comma
email@email.com,email@email.com,email@email.com,
the email addresses are pull out of a database...
here is a small chunk of my code...
$subject = $_POST['subject'];
$message = $_POST['message'];
$result=mysql_query("SELECT * FROM affiliates", $connection); //Selects all entries from table users
while($query_data = mysql_fetch_row($result)) //Selects the first row of returned results
{
echo ("$query_data[9]<br>");
$to .= $query_data[9] . ",";
}
echo ($to);
$to=trim($to);
if ( substr($to, -1)=="," )
{
$length=strlen($to);
$length--;
$finalto=substr($to, $length);
}
else { $finalto=$to; }
echo("<br>Final $finalto");
then, we mail the message using mail() to all of the addresses..