Jump to content

MySql & PHP mail problem


DasHaas

Recommended Posts

Im trying to send emails to all the email addresses in my database table. My table currently has 3 test emails but the script below only send the email to one of the email addresses. What do I need to modify to make it send to all email addresses in the table?

 

    
   $query = mysql_query("SELECT email FROM PXS_Newsletter WHERE verified = 1") or die (mysql_error());
   while($row=mysql_fetch_row($query))
   $email = $row[0];

   $To = $email;
   $Subject = $msgsubject;
   $Body =  $msgbody;
   mail($To, $Subject, $Body);

Link to comment
https://forums.phpfreaks.com/topic/52981-mysql-php-mail-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.