Problem is when I submit this form it shows something went wrong. Could somebody check where I've made a mistake.
HTML code:
  <div class="main">
   <div class="info">Give your feedback</div>
     <form action="mail.php" method="post" name="form" class="form-box">
     <label for="name">Name</label><br>
     <input type="text" name="name" class="inp" placeholder="Enter Your Name" required><br>
     <label for="email">Email</label><br>
     <input type="email" name="email" class="inp" placeholder="Enter Your Email" required><br>
     <label for="phone">Phone</label><br>
    <input type="tel" name="phone" class="inp" placeholder="Enter Your Phone" required><br>
     <input type="submit" name="submit" value="Send" class="sub-btn">
   </form>
 </div>
PHP code
  <?php
     if(isset($_POST['submit'])){
      $name=$_POST['name'];
      $email=$_POST['email'];
      $phone=$_POST['phone'];
      $msg=$_POST['msg'];
      $to='onlyanivar@gmail.com';
      $subject='Form Submission';
      $message="Name:".$name."\n"."Phone:" .$phone. "\n"."Wrote the following: "."\n\n".$msg;
      if(mail($to, $subject, $message, $headers)){
          echo "<h1>Sent Successfully! Thank you"." ".$name.", We will contact you shortly</h1>";   
      }
      else{
          echo "Something went wrong!";
      }
  ?>
 
     
    