title: Created simple HTML form with PHP, but won't POST email and opens blank page
body: <p>I created the following HTML and PHP documents. When I fill in the information and click submit, I don't receive any errors, but I get a blank page and also don't receive an email with the form information. I'm fairly new at this, but could use the help on why I'm not getting the email and how to get rid of the blank page. Thank you.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;head&gt;
    &lt;link href="style.css" rel="stylesheet" type="text/css" /&gt;
  &lt;/head&gt;
  
  &lt;div id="title"&gt;
  &lt;div id="titlecontact"&gt;
  &lt;h1&gt;Excelerate Growth, LLC&lt;/h1&gt;
  &lt;h4&gt;&lt;em&gt;Consulting to Help Small Businesses Excel&lt;/em&gt;&lt;/h4&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;header id="header"&gt;
      &lt;nav class="links" style="--items: 5;"&gt;
          &lt;a href="index.html"&gt;Home&lt;/a&gt;
          &lt;a href="about.html"&gt;About&lt;/a&gt;
          &lt;a href="services.html"&gt;Services&lt;/a&gt;
          &lt;a href="results.html"&gt;Results&lt;/a&gt;
          &lt;a href="contact.html"&gt;Contact&lt;/a&gt;
          &lt;span class="line"&gt;&lt;/span&gt;
      &lt;/nav&gt;
  &lt;/header&gt;
  
  &lt;?=$thankYou ?&gt;
  
  &lt;form class="form" action="contact2.php" method="POST"&gt;
  &lt;h1&gt;CONTACT US&lt;/h1&gt;
  &lt;p class="name"&gt;Name&lt;/p&gt;&lt;input class="nametext" type="text" name="sender" /&gt;
  &lt;p class="email"&gt;Email&lt;/p&gt;&lt;input class="emailtext" type="text" name="senderEmail" /&gt;
  &lt;p class="phone"&gt;Phone&lt;/p&gt;&lt;input class="phonetext" type="tel" name="senderPhone" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}" required /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;p class="interest"&gt;Interest&lt;/p&gt;
  &lt;select class="package" name="type" size="1"&gt;
  &lt;option value="update"&gt;Free Consultation&lt;/option&gt;
  &lt;option value="change"&gt;Growth Management&lt;/option&gt;
  &lt;option value="addition"&gt;Customer Service&lt;/option&gt;
  &lt;option value="new"&gt;Process Management&lt;/option&gt;
  &lt;/select&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;p class="message"&gt;Share More About Your Business&lt;/p&gt;&lt;textarea class="text" name="message" rows="6" cols="25"&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;input class="submit" type="submit" value="Send"&gt;&lt;input class="reset" type="reset" value="Clear"&gt;
  &lt;/form&gt;
  
  &lt;div id="social"&gt;
  &lt;a href="https://www.linkedin.com/company/excelerate-growth/" target="_blank"&gt;&lt;img class="linkedin" src="linkedin.png"&gt;&lt;/a&gt;
  &lt;a href="mailto:excelerategrowth@gmail.com" target="_blank"&gt;&lt;img class="email2" src="email.png"&gt;&lt;/a&gt;
  &lt;a href="https://www.facebook.com/ExcelerateGrowthLLC/" target="_blank"&gt;&lt;img class="facebook" src="facebook.png"&gt;&lt;/a&gt;
  &lt;br/&gt;
  &lt;br/&gt;
  &lt;/div&gt;
  &lt;br/&gt;
  &lt;br/&gt;</code></pre>
  </div>
  </div>
  </p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;?php
  
  if($_POST["submit"]) {
      $recipient="jscotty78@gmail.com";
      $subject="Form to email message";
      $sender=$_POST["sender"];
      $senderEmail=$_POST["senderEmail"];
      $senderPhone=$_POST["senderPhone"];
      $type=$_POST["type"];
      $message=$_POST["message"];
  
      $mailBody="Name: $sender\nEmail: $senderEmail\nPhone: $senderPhone\nType: $type\n$message";
  
      mail($recipient, $subject, $mailBody, "From: $sender &lt;$senderEmail&gt;");
  
      $thankYou="&lt;p&gt;Thank you! Your message has been sent.&lt;/p&gt;";
  }
  
        
  ?&gt;</code></pre>
  </div>
  </div>
  </p>