Hi juju,
For your next post: Please be as clear as possible with your question. We cannot tell from your first post whether you need help with getting started, or whether there is a silly error in your full script.
In your case:
=> Do yu have a user management & login system in place? If you do, you can just allow validated registered users to run a "select * from people " query, and loop through the results to [man]mail[/man] them all with the new message.
pseudo code:
=> Is a person logged in?
yes => Is a person allowed to send mail (e.g., has this user shown a clean track record)
Yes => Run the query on the database
while $row = fetch result => mail ($row[email], 'subject', 'message')
Note that if you have very many people in the list, this can stall your server, and result in timeouts, and you might need to look into mailer scripts in cgi / perl.