Ok great got a working code... and I will point out the problems i ran into to resolve the two or so issues... but I also need help with one more...
First off, instead of having a varible $subject... I just wrote out receipt for transactions... I should had placed it into quotations...
[code=php]mail($to, "Receipt for transactions", $message, $headers);[/code]
Second problem i ran into was $footer and $header -- needed for html emails -- well they could not fit in the mail function together... something about a safe mode error...
third error was it was sending out emails and working great but it was not placing the varibles in the html... So it would just show $city instead of Dallas, Tx... I then said why not just change the 'HTML code in here'; to "HTML code with backslashes in here"; and it worked... I dont understand why though when you suggested changing that to save time from doing backslashes... weird please explain that to me...
<?PHP
require("dbconn.php");
$sql1 = "select * from email";
$result1 = @mysql_query($sql1);
while ( $row = mysql_fetch_array($result1) ) {
$email = $row["email"];
$name = $row["name"];
$descript = $row["descript"];
$descript = wordwrap($descript, 70);
$city = $row["city"];
$price = $row["price"];
$date=$row["timestamp"];
$date = date("m/d/y",strtotime($date));
$to = $email;
$message = "<table width=\"650\" height=\"173\" border=\"1\" bordercolor=\"#0000FF\" bgcolor=\"#CCCCCC\">
<tr>
<td width=\"371\">Name: $name </td>
<td width=\"263\">Location: $city </td>
</tr>
<tr>
<td>Product Description: $descript </td>
<td>Price: $price </td>
</tr>
<tr>
<td colspan=\"2\"><div align=\"right\">Date Of Sale: $date </div></td>
</tr>
</table>";
echo "$message";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$footer = "Have a great day and thanks for shopping with us.";
mail($to, "Receipt for transactions", $message, $headers);
}
?>
That is the final code so far... I have 2 questions more... instead of its saying anonymous@yourwebsite.com. how do i change that to say office@yourwebsite.com?
second question is... how many emails can the mail() before it starts to bog down resorces on the server?
Thank you for all your help also...