Styler001 Posted May 20, 2007 Share Posted May 20, 2007 In my php script is the following code for when a person makes a new guestbook entry on my site: { echo "<br>Your comment has been entered into our guestbook. Thank you.<br><br /><a href=\"javascript:window.close();\">Close Window</a>"; } I would like to add some code to automatically send me an e-mail (let's say to my_email@my_email.com) when the above code is executed. All it needs to say is something like, "New guestbook entry" in the subject line without any message text. I know this is basic stuff. But, for the life of me, I can't remember where I saw an example of this before. And I'm assuming this would be placed before the final }. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/52259-solved-e-mail-notification-of-new-guestbook-entry/ Share on other sites More sharing options...
chigley Posted May 20, 2007 Share Posted May 20, 2007 <?php { mail("my_email@my_email.com", "New Guestbook Entry", ""); echo "<br>Your comment has been entered into our guestbook. Thank you.<br><br /><a href=\"javascript:window.close();\">Close Window</a>"; } ?> Link to comment https://forums.phpfreaks.com/topic/52259-solved-e-mail-notification-of-new-guestbook-entry/#findComment-257844 Share on other sites More sharing options...
warewolfe Posted May 20, 2007 Share Posted May 20, 2007 It's all at http://php.net/function.mail Link to comment https://forums.phpfreaks.com/topic/52259-solved-e-mail-notification-of-new-guestbook-entry/#findComment-257846 Share on other sites More sharing options...
Styler001 Posted May 20, 2007 Author Share Posted May 20, 2007 @chigley: Thanks. Worked like a charm. @warewolfe: Thanks. I'll keep that site bookmarked. Link to comment https://forums.phpfreaks.com/topic/52259-solved-e-mail-notification-of-new-guestbook-entry/#findComment-257854 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.