So, i'm making a newsletter mailer for a small company, they sign up with name and email.. it gets stored in database .. then I made a admin page, an option is to send out an email or newsletter whatever, when you hit send it should send the email to everyone on the database starting with therename EX:
Matthew,
email goes here blah blah blah
so I got it so it emails to every one just cant get the name to show up.. any help would be great, here is the code for reference:
<?
include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$db_data = mysql_query("SELECT first, email FROM contacts");
$subject = 'Urbanformula Newsletter';
$body = $_POST['content'];
$from = "From: \"Urbanformula.com\"";
while ($currRow = mysql_fetch_array($db_data)) {
mail($currRow[1], $subject, $name, $body, $from);
}
?>
any help with this would be great