title: Google Recaptcha Always Return False
body: <p>I am integrating a new Google recaptcha for my customer , i tired on my working server , everything working correctly , but on client server , its go (!$captcha) part.<br>
  Seems like Json responding false every time , i tried with different method but failed.</p>
  
  <p><strong>Here is my code :</strong> </p>
  
  <pre><code>ob_start();
  require("class.phpmailer.php");
  $captcha = $_POST['g-recaptcha-response'];
  $mail = new PHPMailer();
  
  $mail-&gt;IsSMTP();                        // set mailer to use SMTP
  $mail-&gt;Host = "";   // specify main and backup server
  $mail-&gt;SMTPAuth = true;                 // turn on SMTP authentication
  $mail-&gt;Username = "";  // SMTP username
  $mail-&gt;Password = "";               // SMTP password
  
  
  $Name = $_REQUEST['name'];
  $Email = $_REQUEST['email'];
  $Subject = $_REQUEST['subject'];
  $Remarks = $_REQUEST['remarks'];
  
  $mail-&gt;From = "";
  $mail-&gt;FromName = "Vision Pilates Enquiry Form";
  
  $mail-&gt;AddAddress("", "Admin");
  //$mail-&gt;AddAddress("ellen@example.com");                  // name is optional
  $mail-&gt;AddReplyTo("$Email", "$Name");
  
  $mail-&gt;WordWrap = 50;                                 // set word wrap to 50 characters
  //$mail-&gt;AddAttachment("/var/tmp/file.tar.gz");         // add attachments
  //$mail-&gt;AddAttachment("/tmp/image.jpg", "new.jpg");    // optional name
  //$mail-&gt;IsHTML(true);                                  // set email format to HTML
  
  $mail-&gt;Subject = "Enquiry from website: $Subject";
  $mail-&gt;Body    = "&lt;strong&gt;Name:&lt;/strong&gt; $Name &lt;br&gt;&lt;strong&gt;Email:&lt;/strong&gt; $Email &lt;br&gt;&lt;strong&gt;Subject:&lt;/strong&gt; $Subject &lt;br&gt;&lt;strong&gt;Remarks:&lt;/strong&gt; $Remarks &lt;br&gt;"; 
  $mail-&gt;AltBody = "This is the body in plain text for non-HTML mail clients";
  if($_SERVER["REQUEST_METHOD"] === "POST") {
      //form submitted
  
      //check if other form details are correct
  
      //verify captcha
      if (!$captcha) {
          echo '&lt;h2&gt;Please check the the captcha form.&lt;/h2&gt;';
          exit;
      }
      $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret==SecretKey=&amp;response=" . $captcha . "&amp;remoteip=" . $_SERVER['REMOTE_ADDR']);
      if ($response . success == false) {
          echo '&lt;h2&gt;You are spammer ! Get the @$%K out&lt;/h2&gt;';
      } else {
          if (!$mail-&gt;Send()) {
              header("location: error.htm");
              exit;
          } else {
              header("location: sent.htm");
          }
      }
  }
  </code></pre>
  
  <p>after submit end result is <h2>Please check the the captcha form.</h2>.</p>
  
  <p>Thanks</p>