title: i have this error 'HTTP ERROR 500' when i submit this form. could anyone advise me on how to fix this?
body: <p>I'm new to php and want to add a contact form to my website. i found this code but it doesnt seem to submit the form correctly. it comes up with this error 'HTTP ERROR 500' and i'm nt sure how to fix it.</p>
  
  <p>This form is a simple one that i'm using on my portfolio website to allow users to write a message to me as well as leaving their email address and name. </p>
  
  <p>my website is on godaddy on the linux cpanel server. </p>
  
  <pre><code>&lt;?php
      $name = $_POST['name'];
      $visitor_email = $_POST['email'];
      $message = $_POST['message'];
  
      $email_from = 'relay-hosting.secureserver.net';
      $email_subject = "New form submission";
      $email_body = "User name: $name.\n".
                      "User email: $visitor_email.\n".
                          "User message: $message.\n";
  
      $to = "rosie.morrisgrove8@gmail.com";
  
      $headers = "from: $email_from \r\n";
  
      $headers = "Reply-to: $visitor_email \r\n";
  
      mail($to,$email_subject,$email_body,$headers)
  
      header("location: index.html");
  
  ?&gt;
  </code></pre>
  
  <p>Thank you in advance</p>