HTTP Error 405

I’m building a Contact Us Form using this website ( and I’m running into a problem. Here’s my HTML and PHP code.

    <form action="mail.php" method="POST">
        <input type="text" name="name">
        <input type="text" name="email">
        <textarea name="message" rows="6" cols="25"></textarea><br>
        <input type="submit" value="Send"><input type="reset" value="Clear">

    $name = $_POST['name'];
    $email = $_POST['email'];
    $message = $_POST['message'];
    $formcontent="From: $name \n Message: $message";
    $recipient = "";
    $subject = "Contact Form";
    $mailheader = "From: $email \r\n";
    mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
    echo "Thank You!";

*I changed the recipient value to my actual email

I tried running this in VSCode via. the Live Server Extension, but I got this error message.



Where can I go from here? All help is greatly appreciated.

Edit: After some more research, I’ve realized that Live Server doesn’t support PHP. So I guess the question now is do I have to get a hosting platform?

I think so you need a PHP server like wamp, xampp or laragon for the php script works successfully check what is the exactly error that do you have in your network tab of your devTools

1 Like

Thanks for the help! I’ll download xampp and go from there.