ok, in a nutshell:
-table to store email messages:
messages table:
m_id (PK),
subject,
htmlmessage,
lastemailid (value related to your email_addresses table)
active (actual newsletter to send, you set this status in your admin panel)
-sql query to get messages to send in limit?
where do you need to continue your sending:
"select * from messages WHERE active=1"
You can retrieve $lastemailid in your php program, you have $subject and $htmlmessage. Now you have to get email addresses from the table ( email_addresses )
-Get the email messages beginning from $lastemailid:
$sql="select * from email_addresses ea WHERE emailid>$lastemailid ORDER BY emailid LIMIT 100";
These results insode the cycle can be sent out ( examples to go through your results is on php.net mysql_fetch_assoc() )
-method to send:
You should not use the simple mail() function in this program, phpmailer is highly recommended.