jonmbake / bootstrap3-contact-form

Bootstrap 3 Contact Form with Captcha
MIT License
169 stars 84 forks source link

POST is not allowed #32

Open mjkofler opened 3 years ago

mjkofler commented 3 years ago

Hi! Thanks for providing this helpful code. I got the recaptcha and everything else (I think) working, but when I click 'send' it gives an error (in red font with a pink background) below the form on the webpage that says

POST is not allowed

The javascript console says: Failed to load resource: the server responded with a status of 405 (Method Not Allowed) http://127.0.0.1:62140/content/JeBf4dQBRMV_M_PMAAAG/4G4FdfW/S5Rsr7A/3nvbxFg/RRSwf1C/y5u4VNL/w61FBPP/xaTwicQ/library/sendmail.php

I'm testing this on my local machine. I have php installed on macOS BigSur.

I don't see anything obvious in the sendmail.php file that would return this error message. I'm hoping this is something obvious that I'm overlooking!

Please help - thanks!

mjkofler commented 3 years ago

I moved my site into the apache folder on localhost and opened the site at 127.0.0.1 instead of using DreamWeaver's preview function, which resolved the "POST is not allowed" error. When it click send after filling out the form it now adds a green rectangle below the send button but provides not other feedback. I do not get the info from the form sent to my email as expected. Thoughts?

jonmbake commented 3 years ago

The green rectangle indicates the POST request was successful: https://github.com/jonmbake/bootstrap3-contact-form/blob/master/assets/js/contact-form.js#L78. The sendMail script must be returning a 2XX status, but still failing to send for some reason.