Hello, I have a classified ad script and just want it to email me once someone has posted an ad. Can someone give me some code that I can add to the php file? Any help would be appreciated. Thanks!
function signup_notification() { $to = 'you@example.com'; $subject = 'New User Signup Notification'; $message = 'This is the body of the notification email. You can include things like $username signed up!'; $headers = 'From: you@example.com' . "\r\n" . 'Reply-To: roreply@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); } PHP: Put that into a seperate file called signupemail.php or something like that. Change the content (i.e. email address it sends to, and the message it sends). Then add the following code to your existing code so it executes right after a signup occurs: include("path_to_new_code/signupemail.php"); signup_notification(); PHP:
Thanks for the response Christian Little, but I'm getting this error. , Fatal error: Call to undefined function signup_notification() in /path blanked out for obvious reason.