Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6890129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:14:34+00:00 2026-05-27T06:14:34+00:00

I added a Facebook comment box to my website a while ago. What I

  • 0

I added a Facebook comment box to my website a while ago. What I want now is to trigger some code “mail() in php” when someone adds a comment. I want my website to send an email to the user telling him/her that a visitor has left a comment on your item/page.

It was easy to do with the old comment section I created but I don’t know now how to do it with FB. Is it even possible?

If yes please include a detailed answer if you don’t mind since I am not that good at this 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:14:35+00:00Added an answer on May 27, 2026 at 6:14 am

    If you are not happy with the solution FB already provides (as scjosh explained), you can use Facebooks Javascript SDK a bit of ajax (jquery would be my favorite) to load a script with the mail() function.

    First load the JS SDK (make sure you change ‘YOUR_APP_ID’ and the channelURL!!):

    <div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({
          appId      : 'YOUR_APP_ID', // App ID
          channelURL : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
          status     : true, // check login status
          cookie     : true, // enable cookies to allow the server to access the session
          oauth      : true, // enable OAuth 2.0
          xfbml      : true  // parse XFBML
        });
    
        // Additional initialization code here
      };
    
      // Load the SDK Asynchronously
      (function(d){
         var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
         js = d.createElement('script'); js.id = id; js.async = true;
         js.src = "//connect.facebook.net/en_US/all.js";
         d.getElementsByTagName('head')[0].appendChild(js);
       }(document));
    </script>
    

    more information about js sdk, the loading and the channel file can be found here. You should have an app or create an app in facebook for that reason. Information about setting up an app is here.

    Next step is to load the script with the mail() per jquery:

    FB.Event.subscribe('edge.create',
        function(response) {
            $(document).load('mail.php?response='+response);
        }
    );
    

    And finally the mail.php:

    if(isset($_GET['response'])) {
    $msg = 'A comment was left on '.$_GET['response'];
    mail('user@webpage.com','New comment',$msg);
    }
    

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application I've added a Facebook Comment Box (on different pages, for different
As you may know not long time ago facebook added several new features. One
I've got a Facebook app which I've added to a Facebook page. I want
I'd like to add a comment box on my facebook fan page . So
I have a page on my website that I have added the Facebook like
I have added the html5 version of facebook comments to my webpage successfully. Now
I have a Facebook app that is built in PHP and have added a
I'm trying to figure out why the Facebook Like comment box is getting cropped.
I have added facebook meta tags to enable my website to run its video
I'm trying to send an email through the Facebook API. I've added the application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.