title: reCaptcha Shows Success Message Even on Failure
body: <p>I have a contact form in HTML and the form is handled by a PHP file.  ReCaptcha appears to be working but always shows a success message, even on a failure.  What I mean is that a user can submit the form WITHOUT clicking "I'm not a robot", and the message will NOT be sent to me, but on the page, it appears to the user as if it does, because it shows the success message.  </p>
  
  <p>Ideas on what's causing this and how to fix it?  (I do have the proper keys in the code, I just pulled them for this post)</p>
  
  <p>Here's the HTML code::</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;!-- Required meta tags --&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"&gt;
          &lt;meta name="description" content="Welcome to Adam Solton Photography, capturing moments through photography. Professional Prints are available. Specializing in Landscape Photography, Real Estate Photography sessions also available." &gt;
          &lt;meta name="keywords" content="Photography, Landscapes, Waterfalls, Sunsets, Prints, Real Estate Photography" &gt;
          &lt;link rel="icon" href="img/favicon.png" type="image/png"&gt;
          &lt;title&gt;Adam Solton Photography&lt;/title&gt;
          &lt;!-- Bootstrap CSS --&gt;
          &lt;link rel="stylesheet" href="css/bootstrap.css"&gt;
          &lt;link rel="stylesheet" href="vendors/linericon/style.css"&gt;
          &lt;link rel="stylesheet" href="css/font-awesome.min.css"&gt;
          &lt;link rel="stylesheet" href="vendors/owl-carousel/owl.carousel.min.css"&gt;
          &lt;link rel="stylesheet" href="vendors/lightbox/simpleLightbox.css"&gt;
          &lt;link rel="stylesheet" href="vendors/nice-select/css/nice-select.css"&gt;
          &lt;link rel="stylesheet" href="vendors/animate-css/animate.css"&gt;
          &lt;link rel="stylesheet" href="vendors/popup/magnific-popup.css"&gt;
          &lt;!-- main css --&gt;
          &lt;link rel="stylesheet" href="css/style.css"&gt;
          &lt;link rel="stylesheet" href="css/responsive.css"&gt;
  
  &lt;script src="https://www.google.com/recaptcha/api.js" async defer&gt;&lt;/script&gt;
  
  &lt;!-- This script makes Gallery clickable in the nav-bar  --&gt;    
  &lt;script&gt;
  jQuery(function($) {
      $('.dropdown &gt; a').click(function(){
          location.href = this.href;
      });
  });
  &lt;/script&gt;       
  
      &lt;/head&gt;
  
      &lt;!--no right click script--&gt;&lt;script language=JavaScript&gt;var message="All images on this website are copyrighted to Adam Solton Photography.  Please contact me with questions.";function clickIE4(){if (event.button==2){alert(message);return false;}}
  function clickNS4(e){if (document.layers||document.getElementById&amp;&amp;!document.all){if (e.which==2||e.which==3){alert(message);return false;}}}
  if (document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS4;}
  else if (document.all&amp;&amp;!document.getElementById){document.onmousedown=clickIE4;}
  document.oncontextmenu=new Function("alert(message);return false")&lt;/script&gt;&lt;!--end no right click script--&gt;
  
      &lt;style&gt;#g-recaptcha-response {
      display: block !important;
      position: absolute;
      margin: -78px 0 0 0 !important;
      width: 302px !important;
      height: 76px !important;
      z-index: -999999;
      opacity: 0;
  }&lt;/style&gt;
  
      &lt;body&gt;
  
          &lt;!--================Header Menu Area =================--&gt;
          &lt;header class="header_area"&gt;
              &lt;div class="main_menu"&gt;
                  &lt;nav class="navbar navbar-expand-lg navbar-light"&gt;
                      &lt;div class="container"&gt;
                          &lt;!-- Brand and toggle get grouped for better mobile display --&gt;
                          &lt;a class="navbar-brand logo_h" href="index.html"&gt;&lt;img src="img/logo.png" alt=""&gt;&lt;/a&gt;
                          &lt;button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"&gt;
                              &lt;span class="icon-bar"&gt;&lt;/span&gt;
                              &lt;span class="icon-bar"&gt;&lt;/span&gt;
                              &lt;span class="icon-bar"&gt;&lt;/span&gt;
                          &lt;/button&gt;
                          &lt;!-- Collect the nav links, forms, and other content for toggling --&gt;
                          &lt;div class="collapse navbar-collapse offset" id="navbarSupportedContent"&gt;
                              &lt;ul class="nav navbar-nav menu_nav ml-auto"&gt;
                                  &lt;li class="nav-item"&gt;&lt;a class="nav-link" href="index.html"&gt;Home&lt;/a&gt;&lt;/li&gt;
                                  &lt;li class="nav-item"&gt;&lt;a class="nav-link" href="prints.html"&gt;Prints&lt;/a&gt;&lt;/li&gt; 
                                  &lt;li class="nav-item"&gt;&lt;a class="nav-link" href="about-me.html"&gt;About&lt;/a&gt;&lt;/li&gt; 
                                  &lt;li class="nav-item submenu dropdown"&gt;
                                      &lt;a href="gallery.html" class="nav-link" role="button" aria-haspopup="true" aria-expanded="false"&gt;Gallery&lt;/a&gt;
                                      &lt;ul class="dropdown-menu"&gt;
                                          &lt;li class="nav-item"&gt;&lt;a class="nav-link" href="photos_all.html"&gt;&amp;bull; All Photos&lt;/a&gt;
                                          &lt;li class="nav-item"&gt;&lt;a class="nav-link" href="photos_night.html"&gt;&amp;bull; Sunsets, Blue Hour, &amp; Night Photos&lt;/a&gt;&lt;/li&gt;
                                          &lt;li class="nav-item"&gt;&lt;a class="nav-link" href="photos_wf.html"&gt;&amp;bull; Waterfalls &amp; Rivers&lt;/a&gt;&lt;/li&gt;
                                          &lt;li class="nav-item"&gt;&lt;a class="nav-link" href="photos_beaches.html"&gt;&amp;bull; Beaches, Bays, &amp; Marinas&lt;/a&gt;&lt;/li&gt;
                                      &lt;/ul&gt;
                                  &lt;/li&gt; 
                                  &lt;!--&lt;li class="nav-item submenu dropdown"&gt;
                                      &lt;a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"&gt;Blog&lt;/a&gt;
                                      &lt;ul class="dropdown-menu"&gt;
                                          &lt;li class="nav-item"&gt;&lt;a class="nav-link" href="blog.html"&gt;Blog&lt;/a&gt;&lt;/li&gt;
                                          &lt;li class="nav-item"&gt;&lt;a class="nav-link" href="single-blog.html"&gt;Blog Details&lt;/a&gt;&lt;/li&gt;
                                      &lt;/ul&gt;
                                  &lt;/li&gt;--&gt; 
                                  &lt;li class="nav-item active"&gt;&lt;a class="nav-link" href="contact.html"&gt;Contact&lt;/a&gt;&lt;/li&gt;
                              &lt;/ul&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt;
                  &lt;/nav&gt;
              &lt;/div&gt;
          &lt;/header&gt;
          &lt;!--================Header Menu Area =================--&gt;
  
          &lt;!--================Home Banner Area =================--&gt;
          &lt;section class="banner_area_c"&gt;
              &lt;div class="box_1620"&gt;
                  &lt;div class="banner_inner d-flex align-items-center"&gt;
                      &lt;div class="container"&gt;
                          &lt;div class="banner_content text-center"&gt;
                              &lt;h2&gt;&lt;font color="ccd9ff"&gt;Contact Us&lt;/font&gt;&lt;/h2&gt;
                              &lt;div class="page_link"&gt;
                                  &lt;a href="index.html"&gt;Home&lt;/a&gt;
                                  &lt;a href="contact.html"&gt;Contact Us&lt;/a&gt;
                              &lt;/div&gt;
                                  &lt;p&gt;&lt;font color="#ccd9ff"&gt;&lt;i&gt;&lt;font size="5"&gt;This page is still under construction, please bear with me.&lt;/font&gt;
                                  &lt;br&gt;&lt;br&gt;&lt;font size="6"&gt;I can be contacted using the form below. &lt;br&gt;&lt;br&gt; Feel free to contact me for prints, to collaborate, 
                                  &lt;br&gt;or with any questions you may have. &lt;/size&gt;&lt;/i&gt;&lt;/font&gt;&lt;/p&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/section&gt;
          &lt;!--================End Home Banner Area =================--&gt;
  
          &lt;!--================Contact Area =================--&gt;
          &lt;section class="contact_area p_50"&gt;
              &lt;div class="container"&gt;
               &lt;!--   &lt;div id="mapBox" class="mapBox" 
                      data-lat="40.701083" 
                      data-lon="-74.1522848" 
                      data-zoom="13" 
                      data-info="PO Box CT16122 Collins Street West, Victoria 8007, Australia."
                      data-mlat="40.701083"
                      data-mlon="-74.1522848"&gt;
                  &lt;/div&gt;     --&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="col-lg-3"&gt;
                          &lt;div class="contact_info"&gt;
                              &lt;div class="info_item"&gt;
                                  &lt;i class="lnr lnr-home"&gt;&lt;/i&gt;
                                  &lt;h6&gt;Martinez, CA, United States
                                  &lt;br&gt;&lt;br&gt;&lt;font color="red"&gt; Don't forget to check the "I'm not a Robot" box, or it will not go through, even if it looks like it!&lt;/font&gt;&lt;/h6&gt;
                                  &lt;br&gt;&lt;br&gt;
  
                              &lt;/div&gt;
                            &lt;!--  &lt;div class="info_item"&gt;
                                  &lt;i class="lnr lnr-phone-handset"&gt;&lt;/i&gt;
                                  &lt;h6&gt;&lt;a href="#"&gt;00 (440) 9865 562&lt;/a&gt;&lt;/h6&gt;
                                  &lt;p&gt;Mon to Fri 9am to 6 pm&lt;/p&gt;
                              &lt;/div&gt;      
                              &lt;div class="info_item"&gt;
                                  &lt;i class="lnr lnr-envelope"&gt;&lt;/i&gt;
                                  &lt;h6&gt;&lt;a href="mailto:@soltonphoto.com"&gt;my_email_is_here&lt;/a&gt;&lt;/h6&gt;
                                  &lt;p&gt;Send me your questions anytime!&lt;/p&gt;
                              &lt;/div&gt;    --&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="col-lg-9"&gt;
                          &lt;form class="row contact_form" action="contact_process.php" method="post" id="contactForm" novalidate="novalidate"&gt;
                              &lt;div class="col-md-6"&gt;
                                  &lt;div class="form-group"&gt;
                                      &lt;input type="text" class="form-control" id="name" name="name" placeholder="Enter your name"&gt;
                                  &lt;/div&gt;
                                  &lt;div class="form-group"&gt;
                                      &lt;input type="email" class="form-control" id="email" name="email" placeholder="Enter email address"&gt;
                                  &lt;/div&gt;
                                  &lt;div class="form-group"&gt;
                                      &lt;input type="text" class="form-control" id="subject" name="subject" placeholder="Enter Subject"&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              &lt;div class="col-md-6"&gt;
                                  &lt;div class="form-group"&gt;
                                      &lt;textarea class="form-control" name="message" id="message" rows="1" placeholder="Enter Message"&gt;&lt;/textarea&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
  
                              &lt;div class="g-recaptcha" data-sitekey="my_public_key_was_here"&gt;&lt;/div&gt;
  
  
                              &lt;div class="col-md-12 text-right"&gt;
                                  &lt;button type="submit" value="submit" class="btn submit_btn"&gt;Send Message&lt;/button&gt;
                              &lt;/div&gt;
                          &lt;/form&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/section&gt;
          &lt;!--================Contact Area =================--&gt;
  
           &lt;!--================Instagram Area =================--&gt;
          &lt;section class="instagram_area"&gt;
              &lt;div class="container box_1620"&gt;
                  &lt;div class="insta_btn"&gt;
                      &lt;a class="btn theme_btn" href="http://instagram.com/59mango_adam_solton" target="_blank"&gt;Follow me on instagram&lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="instagram_image row m0"&gt;
                      &lt;a href="http://instagram.com/59mango_adam_solton" target="_blank"&gt;&lt;img src="img/instagram/ins-1.jpg" alt=""&gt;&lt;/a&gt;
                      &lt;a href="http://instagram.com/59mango_adam_solton" target="_blank"&gt;&lt;img src="img/instagram/ins-2.jpg" alt=""&gt;&lt;/a&gt;
                      &lt;a href="http://instagram.com/59mango_adam_solton" target="_blank"&gt;&lt;img src="img/instagram/ins-3.jpg" alt=""&gt;&lt;/a&gt;
                      &lt;a href="http://instagram.com/59mango_adam_solton" target="_blank"&gt;&lt;img src="img/instagram/ins-4.jpg" alt=""&gt;&lt;/a&gt;
                      &lt;a href="http://instagram.com/59mango_adam_solton" target="_blank"&gt;&lt;img src="img/instagram/ins-5.jpg" alt=""&gt;&lt;/a&gt;
                      &lt;a href="http://instagram.com/59mango_adam_solton" target="_blank"&gt;&lt;img src="img/instagram/ins-6.jpg" alt=""&gt;&lt;/a&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/section&gt;
          &lt;!--================End Instagram Area =================--&gt;
  
     &lt;!--================Footer Area =================--&gt;
          &lt;footer class="footer_area"&gt;
              &lt;div class="container"&gt;
                  &lt;div class="row footer_inner"&gt;
                      &lt;div class="col-lg-5 col-sm-6"&gt;
                          &lt;aside class="f_widget ab_widget"&gt;
                              &lt;div class="f_title"&gt;
                                  &lt;h3&gt;&lt;font color="#ccd9ff"&gt;Prints are Available!!&lt;/font&gt;&lt;/h3&gt;
                              &lt;/div&gt;
                              &lt;p&gt;Prints are by a professional photo lab, and are available in multiple size and mounting options.  Prints can
                               be mounted to thin plastic (3mm styrene) which is suitable for framing but helps preserve the print,
                               or alternatively, they can be mounted as a standout, which are ready to hang right out of the box.  A standout 
                               has the print mounted on lightweight foam board, finished with edging for a professional quality, and 
                               mounting holes pre-cut in the backing for hanging.  Other mounting options include wood, metal, albums, 
                               and many more.  Please see the &lt;a href="prints.html"&gt;Prints&lt;/a&gt; page for more details.&lt;/p&gt;
                          &lt;/aside&gt;
                      &lt;/div&gt;
                      &lt;div class="col-lg-5 col-sm-6"&gt;
                          &lt;aside class="f_widget news_widget"&gt;
                              &lt;div class="f_title"&gt;
                                  &lt;h3&gt;&lt;font color="#ccd9ff"&gt;Newsletter&lt;/font&gt;&lt;/h3&gt;
                              &lt;/div&gt;
                              &lt;p&gt;Coming Soon!&lt;/p&gt;
                              &lt;!-- &lt;p&gt;Your information will NEVER be sold or shared.  I will also not flood your inbox with nonsense.  But 
                              if you would like to be notified of events or happenings with Adam Solton Photography, please sign up below.&lt;/p&gt;  --&gt;   
                              &lt;div id="mc_embed_signup"&gt;
                                  &lt;form target="_blank" action="https://spondonit.us12.list-manage.com/subscribe/post?u=1462626880ade1ac87bd9c93a&amp;amp;id=92a4423d01" method="get" class="subscribe_form relative"&gt;
                                      &lt;div class="input-group d-flex flex-row"&gt;
                                       &lt;!--   &lt;input name="EMAIL" placeholder="Enter email address" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Email Address '" required="" type="email"&gt;
                                          &lt;button class="btn sub-btn"&gt;&lt;span class="lnr lnr-arrow-right"&gt;&lt;/span&gt;&lt;/button&gt;   --&gt;   
                                      &lt;/div&gt;              
                                      &lt;div class="mt-10 info"&gt;&lt;/div&gt;
                                      &lt;/form&gt;
                              &lt;/div&gt;
                          &lt;/aside&gt;
                      &lt;/div&gt;
                      &lt;div class="col-lg-2"&gt;
                          &lt;aside class="f_widget social_widget"&gt;
                              &lt;div class="f_title"&gt;
                                  &lt;h3&gt;&lt;font color="#ccd9ff"&gt;Social Media&lt;/font&gt;&lt;/h3&gt;
                              &lt;/div&gt;
                              &lt;p&gt;Follow me on Instagram and Facebook, and be the first to see new captures.&lt;/p&gt;
                              &lt;ul class="list"&gt;
                                  &lt;li&gt;&lt;a href="http://instagram.com/59mango_adam_solton" target="_blank"&gt;&lt;i class="fa fa-instagram"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
                                  &lt;li&gt;&lt;a href="https://www.facebook.com/asolton" target="_blank"&gt;&lt;i class="fa fa-facebook"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
                                  &lt;/ul&gt;
                          &lt;/aside&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;p&gt;&lt;center&gt;&lt;font color="a9a9a9"&gt;All images and page content &amp;copy; Copyright Adam Solton Photography&lt;Br&gt; &lt;a href="https://www.soltonphoto.com"&gt;soltonphoto.com&lt;/a&gt; &amp;copy;&lt;script&gt;document.write(new Date().getFullYear());&lt;/script&gt; All rights reserved&lt;/center&gt;&lt;/font&gt;&lt;/p&gt;
  
  &lt;font color="black"&gt;&lt;p&gt;&lt;!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. --&gt;
   | This template is made with &lt;i class="fa fa-heart-o" aria-hidden="true"&gt;&lt;/i&gt; by &lt;a href="https://colorlib.com" target="_blank" style="color: rgb(0,0,0)"&gt;&lt;font color="000000"&gt;Colorlib&lt;/font&gt;&lt;/a&gt;
  &lt;!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. --&gt;
  &lt;/font&gt;&lt;/p&gt;
  
  
          &lt;/footer&gt;
          &lt;!--================End Footer Area =================--&gt;
  
  
  
          &lt;!--================Contact Success and Error message Area =================--&gt;
          &lt;div id="success" class="modal modal-message fade" role="dialog"&gt;
              &lt;div class="modal-dialog"&gt;
                  &lt;div class="modal-content"&gt;
                      &lt;div class="modal-header"&gt;
                          &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;
                              &lt;i class="fa fa-close"&gt;&lt;/i&gt;
                          &lt;/button&gt;
                          &lt;h2&gt;Thank you&lt;/h2&gt;
                          &lt;p&gt;Your message is successfully sent...&lt;/p&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;!-- Modals error --&gt;
  
          &lt;div id="error" class="modal modal-message fade" role="dialog"&gt;
              &lt;div class="modal-dialog"&gt;
                  &lt;div class="modal-content"&gt;
                      &lt;div class="modal-header"&gt;
                          &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;
                              &lt;i class="fa fa-close"&gt;&lt;/i&gt;
                          &lt;/button&gt;
                          &lt;h2&gt;Sorry !&lt;/h2&gt;
                          &lt;p&gt; Something went wrong &lt;/p&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;!--================End Contact Success and Error message Area =================--&gt;
  
  
  
  
          &lt;!-- Optional JavaScript --&gt;
          &lt;!-- jQuery first, then Popper.js, then Bootstrap JS --&gt;
          &lt;script src="js/jquery-3.3.1.min.js"&gt;&lt;/script&gt;
          &lt;script src="js/popper.js"&gt;&lt;/script&gt;
          &lt;script src="js/bootstrap.min.js"&gt;&lt;/script&gt;
          &lt;script src="js/stellar.js"&gt;&lt;/script&gt;
          &lt;script src="vendors/lightbox/simpleLightbox.min.js"&gt;&lt;/script&gt;
          &lt;script src="vendors/nice-select/js/jquery.nice-select.min.js"&gt;&lt;/script&gt;
          &lt;script src="vendors/isotope/imagesloaded.pkgd.min.js"&gt;&lt;/script&gt;
          &lt;script src="vendors/isotope/isotope.pkgd.min.js"&gt;&lt;/script&gt;
          &lt;script src="vendors/popup/jquery.magnific-popup.min.js"&gt;&lt;/script&gt;
          &lt;script src="vendors/owl-carousel/owl.carousel.min.js"&gt;&lt;/script&gt;
          &lt;script src="js/jquery.ajaxchimp.min.js"&gt;&lt;/script&gt;
          &lt;script src="js/mail-script.js"&gt;&lt;/script&gt;
          &lt;script src="vendors/counter-up/jquery.waypoints.min.js"&gt;&lt;/script&gt;
          &lt;script src="vendors/counter-up/jquery.counterup.js"&gt;&lt;/script&gt;
          &lt;!-- contact js --&gt;
          &lt;script src="js/jquery.form.js"&gt;&lt;/script&gt;
          &lt;script src="js/jquery.validate.min.js"&gt;&lt;/script&gt;
          &lt;script src="js/contact.js"&gt;&lt;/script&gt;
          &lt;!--gmaps Js--&gt;
          &lt;script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCjCGmQ0Uq4exrzdcL6rvxywDDOvfAu6eE"&gt;&lt;/script&gt;
          &lt;script src="js/gmaps.min.js"&gt;&lt;/script&gt;
          &lt;script src="js/theme.js"&gt;&lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here's the full PHP code:</p>
  
  <pre><code>&lt;?php
  
  //reCAPTCHA validation
  //Checking For reCAPTCHA
  $captcha;
  if (isset($_POST['g-recaptcha-response'])) {
      $captcha = $_POST['g-recaptcha-response'];
  }
  // Checking For correct reCAPTCHA
  $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=my _secret_key_is_here_&amp;response=" . $captcha);
  if (!$captcha || $response.success == false) {
      echo "Your CAPTCHA response was wrong.";
      exit ;
  }
  
  
      $to = "my_email_is_here";
      $from = $_REQUEST['email'];
      $name = $_REQUEST['name'];
      $csubject = $_REQUEST['subject'];
      $number = $_REQUEST['number'];
      $cmessage = $_REQUEST['message'];
  
      $headers = "From: $from";
      $headers = "From: " . $from . "\r\n";
      $headers .= "Reply-To: ". $from . "\r\n";
      $headers .= "MIME-Version: 1.0\r\n";
      $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
  
      $subject = "You have a message from SoltonPhoto.com.";
  
      $logo = '../img/logo.png';
      $link = '#';
  
      $body = "&lt;!DOCTYPE html&gt;&lt;html lang='en'&gt;&lt;head&gt;&lt;meta charset='UTF-8'&gt;&lt;title&gt;Express Mail&lt;/title&gt;&lt;/head&gt;&lt;body&gt;";
      $body .= "&lt;table style='width: 100%;'&gt;";
      $body .= "&lt;thead style='text-align: center;'&gt;&lt;tr&gt;&lt;td style='border:none;' colspan='2'&gt;";
      $body .= "&lt;a href='{$link}'&gt;&lt;img src='{$logo}' alt=''&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;";
      $body .= "&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;";
      $body .= "&lt;td style='border:none;'&gt;&lt;strong&gt;Name:&lt;/strong&gt; {$name}&lt;/td&gt;";
      $body .= "&lt;td style='border:none;'&gt;&lt;strong&gt;Email:&lt;/strong&gt; {$from}&lt;/td&gt;";
      $body .= "&lt;/tr&gt;";
      $body .= "&lt;tr&gt;&lt;td style='border:none;'&gt;&lt;strong&gt;Subject:&lt;/strong&gt; {$csubject}&lt;/td&gt;&lt;/tr&gt;";
      $body .= "&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;";
      $body .= "&lt;tr&gt;&lt;td colspan='2' style='border:none;'&gt;{$cmessage}&lt;/td&gt;&lt;/tr&gt;";
      $body .= "&lt;/tbody&gt;&lt;/table&gt;";
      $body .= "&lt;/body&gt;&lt;/html&gt;";
  
      $send = mail($to, $subject, $body, $headers);
  
  ?&gt;
  </code></pre>