Forums

PHP

This topic is locked

Emailing MySQL Records Using PHP

Posted 22 Jul 2003 17:32:04
1
has voted
22 Jul 2003 17:32:04 Andrew Watson posted:
I am trying to search a MySQL database... select a number of the records and then email them.

If I create a QUERY and then run the following email lines...
----------------------------------------------------------------------
$to = " ";
$subject = "Website Info";
$message = "hello message\n\n";
$message .= $row_rcdInfo['ItemID'] . "\n\n";
$message .= $row_rcdInfo['Name'] . "\n\n";
$message .= $row_rcdInfo['Quantity'] . "\n\n";
$from = "From: Website < >";
$header = "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html; charset=iso-8859-1\r\n";
$header .= $from; // set the from field in the header
$header .= "\n"; // add a line feed
mail($to, $subject, $message, $header); // send the e-mail
----------------------------------------------------------------------

The first record is sent fine... I am just not sure how to incorporate a repeat region in this senario... essentially can anyone let me know the best way of emailing data (or if there are any extentions out there) from a MySQL database...

Reply to this topic