My E-mail script is working statically.
$inbox = 'email@aceshockey.com';
$message .= '</body></html>';
if(!mail($inbox, "ACES HOCKEY | $title", $message, "From: noreply@aceshockey.com\n" . "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1")) {
header('Location: content.php');
}
else {
header('Location: email-error.php');
}
I want to implement some code to have my variable $inbox equal to all users emails from a table.
I tried this:
mysql_select_db($database_Creative, $Creative);
$data = mysql_query("SELECT Email_E FROM admin WHERE Email_E IS NOT NULL") or die(mysql_error());
while($info = mysql_fetch_array( $data )) {
print "".$info['Email_E'] . "";
print ","; }
$inbox = "'".$data."';";
I know the problem is how I am connecting my data in my query, the query is pulling the proper information.
Basically I want $inbox variable to be equal to users e-mails seperated by commas like this:
$inbox = 'email@email.com,email@email.com,email@email.com,email@email.com';
Thanks for any help!