forcom Posted June 25, 2009 Share Posted June 25, 2009 Hello I don`t know how to start this code. What code will allow me to know when new entry added to my table. I want to write a code that will email me when table information. Not when user submit. Quote Link to comment https://forums.phpfreaks.com/topic/163580-help-with-email/ Share on other sites More sharing options...
chmpdog Posted June 25, 2009 Share Posted June 25, 2009 well what I would do is when php inserts the entry into the table just have a mail() function Quote Link to comment https://forums.phpfreaks.com/topic/163580-help-with-email/#findComment-863083 Share on other sites More sharing options...
forcom Posted June 25, 2009 Author Share Posted June 25, 2009 The id in the table is set on auto. How would I get the the code to give me the new id that just got created and email me that information. Quote Link to comment https://forums.phpfreaks.com/topic/163580-help-with-email/#findComment-863111 Share on other sites More sharing options...
chmpdog Posted June 25, 2009 Share Posted June 25, 2009 just set the id to a variable then do something like this: $to = "d@gmail.com"; $subject = '[instant Email Contact Form] : ' . $subject; // the mail message ( add any additional information if you want ) $msg = "message ".$id." rest of message"; if(mail($to, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n")) { ?> Quote Link to comment https://forums.phpfreaks.com/topic/163580-help-with-email/#findComment-863114 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.