title: Need mail function inside index.php
body: <p>need to add mail() to my index.php I tried and it wont work.
  I have tried this a couple different ways and have read the php webpage, Idk why its not working</p>
  
  <pre><code>&lt;div class="card p-3"&gt;
  &lt;form action="insert.php" method="post" enctype="multipart/form-data"&gt;
    &lt;div class="form-group text-center"&gt;
      &lt;h3 style="color:#5892c5;"&gt;Schedule Your Free Quote&lt;/h3&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="exampleInputName"&gt;Name&lt;span class="required"style="color:red;"&gt; *&lt;/span&gt;&lt;/label&gt;
      &lt;input type="text" name="customer" class="form-control" id="exampleInputName" aria-describedby="nameHelp" placeholder="Enter First + Last Name"&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="exampleInputPhone"&gt;Phone Number&lt;span class="required"style="color:red;"&gt; *&lt;/span&gt;&lt;/label&gt;
      &lt;input type="phone" name="phone" class="form-control" id="exampleInputPhone" aria-describedby="phoneHelp" placeholder="Enter Mobile Phone"&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="exampleInputEmail1"&gt;Email address&lt;/label&gt;
      &lt;input type="email" name="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email"&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="exampleInputConcerns"&gt;Any Concerns?&lt;/label&gt;
      &lt;textarea class="form-control rounded-0" name="concerns" id="exampleFormControlTextarea2" rows="3" placeholder="Message"&gt;&lt;/textarea&gt;
    &lt;/div&gt;
  
    &lt;button type="submit" class="btn btn-primary"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  &lt;?php
  
    $message = $_POST['name'] . $_POST['phone'] . $_POST['email'] . $_POST['concerns'];
  
    $email_subject = "New Form submission";
  
    $email_body = "You have received a new message from the user \n".
                              "Here is the message:\n $message".
  
    $to = "my_email@email.com";
  
  
    mail($to,$email_subject,$email_body);
  ?&gt;
  &lt;/div&gt;
  </code></pre>