Mailing database-input after storing in DB

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have a registration form using php to process it and store values in
MySQL. That works. But I also would like to get a mail with each
registration input into the database. Anyone with any tip on where to
add this code in the insert-script? At the very beginning, in the
middle, or at the end? And will this piece of code actually mail me
each input? I can't get it to work.

if (phpversion() > "4.0.6") {
if (isset($HTTP_POST_VARS["tipsViaEpost"])) {
// make email info
$to =
$subject = "New registration";
$from = "From: Registration DB\r\n";
$body = "Details stored in db:-\n\n";
while (list($key,$value) == each($HTTP_POST_VARS)) {
$body.= $key . " = " . $value . "\n";

// now send the mail

// then redirect to another page
header("Location: registrationSent.php");

Re: Mailing database-input after storing in DB

Quoted text here. Click to load it

Is your sendmail configured or set up?  Try sending a test mail from
the command line.
SOme mailers wont let you put multiple addresses in the 'to'
parameter.  You might also want to try sending the mail to each
recipient separately.

Site Timeline