You can e-mail the information using the mail() command.
If all the data you need is already 'in' the PHP page, then its easy - would look something like this...
mail($emailto, $subject, $mailmessage, $headers);
or if you want just to send the same message every time, you could include the relevant stuff directly like this
mail("harrypotter@hogwarts.com","New Magi-viagra","Use our new product and never have your wand let you down again!");
The headers part is optional, but if you wanted to make your message HTML then you would need to include some headers in there. For more on that, there is a post a couple of weeks back which will tell you about that - because I had a question on it and got some really useful replies.
If you need to get data out of the database to send in your e-mail, you would need to do a bit more. Like, say you are storing data with a unique ID which is auto-incremented...and you want to quote that ID number in the mai - after you add the new data, you would then need to re-interrogate the DB to get the id of the entry you just created. Like this
$result = mysql_query("SELECT max(id_num) FROM my_database");
$row=mysql_fetch_row($result);
$the_id_num= $row[0];
Then you can include $the_id_num in your message too. Etc..
Hope that made sense... good luck.
Last edited by tobyw_1969; 07-20-2003 at 11:12 AM.
Bookmarks