I'm currently using a mailer.php file for a minimal contact form
However I have noticed recently then when submitting the form, I am getting the following error;
HTTP Error 405.0 - Method Not Allowed The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.
My mailer.php file is the following
<?php $email_to = "[email protected]"; $name = $_POST["name"]; $email_from = $_POST["[email protected]"]; $message = $_POST["message"]; $email_subject = "Feedback from website"; $headers = "From: " . $email_from . "\n"; $headers .= "Reply-To: " . $email_from . "\n"; $message = "Name: ". $name . "\r\nMessage: " . $message; ini_set("sendmail_from", $email_from); $sent = mail($email_to, $email_subject, $message, $headers, "-f" .$email_from); if ($sent) { header("Location: "); } else { echo "There has been an error sending your message. Please try later."; } ?> The form using this file has the following form tag
<form method="post" action="mailer.php"> PHP is not my strong point so I'm not sure why this maybe happening. The form itself does not have a captcha field. Could spam be the root of the issue?
I'd appreciate anyone who can shed this light on this for me
3Related questions 0 PHP mail not functioning 2 PHPMailer not working: Message could not be sent 1 Contact Form with PHPMailer Related questions 0 PHP mail not functioning 2 PHPMailer not working: Message could not be sent 1 Contact Form with PHPMailer 2 PHP Contact Form Mail Function Not Working 1 Getting Error 405 (Not Allowed) on PHPMailer 1 405 HTTP verb used to access this page is not allowed 0 Issue with contact form (html and php): 405 not allowed 1 Failed to load resource: the server responded with a status of 404 (Not Found) on contact form using Js, ajax, php 0 What is wrong with my php mail contact form? 1 PHP Contact Form Issue - 400 error, can't see the fault Load 7 more related questions Show fewer related questions
Reset to default