Re:dynamically write recordset values to an array (1 viewing) (1) Guests
dynamically write recordset values to an array
by jahflasher 4 Months, 3 Weeks ago
I found a simple example of how to send mass email for newsletter http://www.phpeveryday.com/articles/PHP-Email-Sending-Mass-Email-use-BCC-P136.html. The process uses an static array of email address. I want to get all email addresses from a data_base_ then dynamically write these email values to an array. Any idea how to do that dynamically write the values of a recordset to an array. Thanks in advance.
Last Edit: 03/26/2008 01:50am By jahflasher.
The administrator has disabled public write access. | Report to moderator   Logged Logged  
Re:dynamically write recordset values to an array
by jahflasher 4 Months, 3 Weeks ago
I have found an easier way to send mass email. It works but i am not sure if it is the most efficient:
Code: :

  $emailsql="select email from pie_mail where subscribe='Y'"; $runemail=mysql_query($emailsql)or die (mysql_error());                         $email_num=mysql_num_rows($runemail); $i=0; while ($row_Email=mysql_fetch_assoc($runemail)){                          $mynum=$row_Email['email'];                           $i++;                                                                                     $from=" This e-mail address is being protected from spam bots, you need JavaScript enabled to view it "; $to=$mynum; $headers "MIME-Version: 1.0" "\r_CRLF_"; $headers .= "Content-type:text/html;charset=iso-8859-1" "\r_CRLF_"; $headers .= "From: $from" "\r_CRLF_"; $body=$message; $subject=$title;                 if (mail($to$subject$body$headers)){ echo "<div class=\"row2\"><font class=\"style4\"><img                      src=\"../images/tick.png\" width=\"16\" height=\"16\" /> $mynum Subscription message sent!</font></div><br>"; }else { echo "<div class=\"row2\"><font class=\"style4\"><img                        src=\"../images/cancel.png\" width=\"16\" height=\"16\" />  $mynum  Subscription message fail to deliever!</font></div><br>";                         }                                                                          }



Only thing is that the headers for html does not work. Maybe one of you all could fix it for me.
Last Edit: 03/27/2008 05:56pm By jahflasher.
The administrator has disabled public write access. | Report to moderator   Logged Logged  
 
     
Powered by FireBoardget the latest posts directly to your desktop