I want to use mail() to send a message to a group of addresses in a mysql
table. I¹ve got my mail script and my sql query, but I don¹t know how to
format the query results to fit into the mail() function.
Does anyone have a simple script that will format a list of email addresses
(from a mysql query) then dump them into a variable that I can use in a
mail() function?
Here¹s what I got so far:
mysql_select_db ($database_mail inglist, $mailinglist);
$query_email = "SELECT * FROM emailaddress";
$email = mysql_query($qu ery_email, $mailinglist) or die(mysql_error ());
$row_email = mysql_fetch_ass oc($email);
$totalRows_emai l = mysql_num_rows( $email);
mail($addresses , "Successful Test", "Successful mail sent")
FYI ... I¹m a novice programmer at best ...
table. I¹ve got my mail script and my sql query, but I don¹t know how to
format the query results to fit into the mail() function.
Does anyone have a simple script that will format a list of email addresses
(from a mysql query) then dump them into a variable that I can use in a
mail() function?
Here¹s what I got so far:
mysql_select_db ($database_mail inglist, $mailinglist);
$query_email = "SELECT * FROM emailaddress";
$email = mysql_query($qu ery_email, $mailinglist) or die(mysql_error ());
$row_email = mysql_fetch_ass oc($email);
$totalRows_emai l = mysql_num_rows( $email);
mail($addresses , "Successful Test", "Successful mail sent")
FYI ... I¹m a novice programmer at best ...
Comment