Hello,
It's me again, I am creating a database that sends out a newsletter. Everthing seems to work,except that no emails are sent (I'm not getting any errors)
Please help, this is my code
<?
session_start();
if($valid !="yes") {
header("Location: contact_menu.php");
exit;
} else {
session_register('valid');
}
$db_name = "ecomphpdb";
$table_name = "justin_contacts";
$connection = @mysql_connect("localhost", "ecomphpstudents",
"makesites") or die("Couldn't connect - please try later.");
$db = @mysql_select_db($db_name, $connection) or die("Error2 -
Couldn't connect - please try later.");
$sql = "SELECT email
FROM $table_name";
$result = @($sql, $connection) or die("Error3 - Couldn't
connect - please try later.");
// while there are rows of results to get from the database table
while($row = @mysql_fetch_array($result))
{ //start while
//new variable $id holds the id for the first row in the result array
called $row
$id = $row['id'];
$email = $row['email'];
} //end while
// *********** Validate *******************
if(($message == ""))
{
header("Location: htmlEmail.htm");
exit;
}
// ***** start of email to customer *******
$msg = "$message\n";
$to = "$email";
$subject = "Newsletter";
$mailheaders = "From: jblayney@jrbgraphicdesign.com\n";
$mailheaders .= "Reply-To: jblayney@jrbgraphicdesign.com";
$mailheaders .= "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-type: text/html; charset=iso-2022-jp\r\n";
mail($to,$subject,$msg,$mailheaders);
// ****** end of customer email *********
?>
<head><title>Justin Blayney</title></head>
<body>
<h3>Your email has been sent</h3>
</body>