Jump to content

[SOLVED] E-mail notification of new guestbook entry


Styler001

Recommended Posts

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
Share on other sites

<?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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.