Jump to content

Email list from mysql


nealec

Recommended Posts

This just sends me multiple emails with a different name in each one rather than all the names in one email.

 

<?php

$servername="*******";
$username="*******";
$password="*******";
$conn=  mysql_connect($servername,$username,$password)or die(mysql_error());
mysql_select_db("*******",$conn);			

$result = mysql_query("SELECT name FROM people WHERE mail='yes' ");
while($row = mysql_fetch_array($result)){

$to = "[email protected]";
		$subject = "People names";
		$body = "This is a list of all names in database.

$row[name]";
		mail($to, $subject, $body);
		}
?>

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.