title: Contact form PHP showing status of 405 method not allowed on IIS
body: <p>I have a template I downloaded and with it came a PHP form. I have tried to fill in the form and send but it does nothing. The console shows:</p>
  
  <blockquote>
    <p>Failed to load resource: the server responded with a status of: 405 (Method Not Allowed)</p>
  </blockquote>
  
  <p>HTML: </p>
  
  <pre><code>  &lt;form action="contact-form.php" method="POST" class="contact-form"&gt;
                    &lt;ul class="row"&gt;
                      &lt;li class="col-md-6 form-item"&gt;
                        &lt;label for="contact-name"&gt;&lt;i class="ico-male"&gt;&lt;/i&gt;&lt;/label&gt;
                        &lt;input type="text" name="contact-name" class="contact-name" id="contact-name" value="Your Name" onblur="if(this.value=='')this.value='Your Name'" onfocus="if(this.value=='Your Name')this.value=''"&gt;
                      &lt;/li&gt;
                      &lt;li class="col-md-6 form-item"&gt;
                        &lt;label for="contact-email"&gt;&lt;i class="ico-email"&gt;&lt;/i&gt;&lt;/label&gt;
                        &lt;input type="email" name="contact-email" class="contact-email" id="contact-email" value="Your Email" onblur="if(this.value=='')this.value='Your Email'" onfocus="if(this.value=='Your Email')this.value=''"&gt;
                      &lt;/li&gt;
                      &lt;li class="col-md-12 form-item"&gt;
                        &lt;label for="contact-message"&gt;&lt;i class="ico-bubble"&gt;&lt;/i&gt;&lt;/label&gt;
                        &lt;textarea name="contact-message" class="contact-message" id="contact-message" data-placeholder="Your message"&gt;&lt;/textarea&gt;
                      &lt;/li&gt;
                      &lt;li class="col-md-12 form-item"&gt;
                        &lt;input type="submit" name="contact-btn" class="contact-btn general-link" id="contact-btn" value="Send Your Message"&gt;
                      &lt;/li&gt;
                    &lt;/ul&gt;
                  &lt;/form&gt;&lt;!-- end of contact form --&gt;
  </code></pre>
  
  <p>PHP: </p>
  
  <pre><code>&lt;?php
  
  if($_POST["submit"]) {
  
      $fromEmail      =  strip_tags($_POST['contact-email']);
      $fromName       =  strip_tags($_POST['contact-name']);
      $themessage     =  strip_tags($_POST['contact-message']);
      $themessage     =  $themessage."The Sender Is ( ".$fromName." )" ; 
  
  
  
      $toEmail = 'jh@gmail.com';
      $toName = 'JH';
  
      Mail::send('emails.contactus', $data , function($message) use ($toEmail, $toName, $fromEmail, $fromName, $subject)
      {
          $message-&gt;to($toEmail, $toName);
  
          $message-&gt;from($fromEmail, $fromName);
  
          $message-&gt;subject($subject);
      });
  
  $headers = 'From:' .$fromName . "\r\n" .
      'Reply-To:' .$fromEmail. "\r\n" .
      'X-Mailer: PHP/' . phpversion();
  
  
  
  if(mail($toEmail, $subject, $themessage, $headers))
  {
  
        // Send 
  echo "success";
  
  }
  else{ echo "An error has be occured"; }
  }
  
  ?&gt;
  </code></pre>
  
  <p>I am doing this locally on IIS server and receiving this.</p>
  
  <p>I have installed PHP and now am receiving this error: </p>
  
  <blockquote>
    <p>Failed to load resource: the server responded with a status of 500 (Internal Server Error)</p>
  </blockquote>