send PHP confirmation email contact form without using action=""

Solution:
Ideally the sending of confirmation email now needs to be handled over at: https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8
There are hacky ways around this... you could empty the action again so it submits to your script, then use curl to make your script re-submit the data to https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8 and send then email based on the response.
You could also send an ajax request to your script on form submission, where your script handles the sending of the email.
But these are both very hacky, and ultimately the job of responding/informing the user of the success/failure of the form submission is the responsibility of the script the form data is being submitted to.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: the payload is invalid.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.