Newsletter???

From: Date: Thu, 24 Apr 2003 13:05:01 +0000
Subject: Newsletter???
Groups: php.general 
Request: Send a blank email to php-general+get-145148@lists.php.net to get a copy of this message
Hi guys what I’m after is an exemple of how to create a newsletter with the mail function. It would be something like: There is a MySql database that holds all the emails. You should open a page with a form, and this form should have for an action a php file that access the database and send the message in the form for all the emails in the database. Here is what I got until now but it doesnt work... <? include "db_dados.php"; $sql = "SELECT email FROM tb_newsletter"; $result = mysql_query($sql); $Remetente = "r.oliveira@be-eone.com.br"; $Assunto = "$subject"; $Mensagem = $message; while($myrow = mysql_fetch_array($result)) { $Destino = "$myrow['email']"; echo ("$Destino"); mail($Destino,"$Assunto",$Mensagem,"From:$Remetente\n"); } ?> the db_dados.php has the connection information and it is right. Rodrigo de Oliveira Costa Gerente de Produção Be-eone

« previous php.general (#145148) next »