title: properly setting email subject line delivered from email form
body: <p>I have a email form for my website but here is the issue: when i receive an email, the subject line in my inbox shows whatever the user inputted as subject in the form. id like to override that so that whenever an email comes in. the subject in the email header is always "an inquiry from your website". In the message body, sure i don't mind their specific subject they entered but when I receive an email, id like consistency in my inbox.</p>
  
  <p>this is the current code:</p>
  
  <pre><code>&lt;?php session_start();
  if(isset($_POST['Submit'])) {   if( $_SESSION['chapcha_code'] == $_POST['chapcha_code'] &amp;&amp; !empty($_SESSION['chapcha_code'] ) ) {
  $youremail = 'xxxxxxxxx';
  $fromsubject = 'An inquiry from your website';
  $title = $_POST['title'];
  $fname = $_POST['fname'];
  $lname = $_POST['lname'];
  $mail = $_POST['mail'];
  $address = $_POST['address']; 
  $city = $_POST['city']; 
  $zip = $_POST['zip']; 
  $country = $_POST['country']; 
  $phone = $_POST['phone']; 
  $subject = $_POST['subject']; 
  $message = $_POST['message']; 
  $headers = "From: $nome &lt;$mail&gt;\r\n";
  
      $to = $youremail; 
      $mailsubject = 'Message received from'.$fromsubject.' Contact Page';
      $body = $fromsubject.'
  
      The person that contacted you is  '.$fname.' '.$lname.'
       Address: '.$address.'
      '.$city.', '.$zip.', '.$country.'
       Phone Number: '.$phone.'
       E-mail: '.$mail.'
       Subject: '.$subject.'
  
       Message: 
       '.$message.'
  
      |---------END MESSAGE----------|'; 
  echo "Thank you for inquiring. We will contact you shortly.&lt;br/&gt;You may return to our &lt;a href='/index.html'&gt;Home Page&lt;/a&gt;"; 
                                  mail($to, $subject, $body, $headers);
          unset($_SESSION['chapcha_code']);
     } else {
          echo 'Sorry, you have provided an invalid security code';
     }
   } else { 
  echo "You must write a message. &lt;/br&gt; Please visit our &lt;a href='/contact.html'&gt;Contact Page&lt;/a&gt; and try again."; 
  }
  ?&gt; 
  </code></pre>