title: access denied. PHP script
body: <p>I have a contact form, when submitting on my <a href="http://www.medical-device-regulations.com/contact" rel="nofollow">page</a> says 'Access denied.' There is nothing else, so I can't seem to figure out how to debug.</p>
  
  <p>Here is the code :</p>
  
  <pre><code>&lt;?php
  
      $EmailFrom = "username@email.com";
      $EmailTo = "username@email.com, username2@email.com";
      $Subject = "Subject";
  
      $Name = Trim(stripslashes($_POST['Name'])); 
      $Company = Trim(stripslashes($_POST['Company'])); 
      $Email = Trim(stripslashes($_POST['Email'])); 
      $Tel = Trim(stripslashes($_POST['Tel']));
  
      $Message = Trim(stripslashes($_POST['Message'])); 
  
      // Validation
      $validationOK = true;
      if (! $validationOK)
      {
          print "&lt;meta http-equiv=\"refresh\" content=\"0;URL=error.htm\"&gt;";
          exit;
      }
  
      // Prepare Email Body Text
      $Body = "";
      $Body .= "Name: ";
      $Body .= $Name;
      $Body .= "\n";
      $Body .= "Company: ";
      $Body .= $Company;
      $Body .= "\n";
      $Body .= "Tel: ";
      $Body .= $Tel;
      $Body .= "\n";
      $Body .= "Further comments: ";
      $Body .= $Message;
      $Body .= "\n";
  
      // Send Email 
      $success = mail($EmailTo, $Subject, $Body, "From: &lt;$Email&gt;");
  
      // Redirect To Success Page 
      if ($success)
      {
          echo '&lt;script&gt;alert("Thanks for your message, somebody will get in touch with your shortly.");&lt;/script&gt;';
          echo "&lt;meta http-equiv=\"refresh\" content=\"0;URL=../contact\"&gt;";
      }
      else
      {
          echo '&lt;script&gt;alert("There has been an error, please try again later.");&lt;/script&gt;';
          echo '&lt;script&gt;history.back(1);&lt;/script&gt;';
          exit;
      }
  ?&gt;
  </code></pre>
  
  <p>I'm not sure why it's not working, could someone shed some light on this?</p>