Re: Emails from database...

From: Date: Thu, 05 Apr 2001 02:21:55 +0000
Subject: Re: Emails from database...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47154@lists.php.net to get a copy of this message
On Wed, 4 Apr 2001 16:58, Dhaval Desai wrote: > Hi! > > > This is my code for sending email to all the emails in > my database: > > $connect = mysql_connecT(); > $query = "select email from table"; > $execute = mysql_db_query("database", $query); > > while($r=mysql_fetch_array($execute)) > { > $email .= $r('email') > > mail("$email", "My Subject", "Line 1\nLine 2\nLine > 3"); > } > > > > Will this send email to all the emails in the > database? > Is there any otehr wya of doing it? > > > Thank You > > Dhaval Desai If you fix your syntax in the line starting $email, and if you comma separate the list of email addresses, and put the mail function outside the loop, and there aren't too many mails for your MTA, you might have some success. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#47154) next »