Does it indicate that the mail was successful by showing the message has been sent? Although you should be using isset() checks to ensure that the name, email and message are provided (NEVER make use of the $_POST['submit']), the PHP is otherwise fine.
Since you don't have a submit button, I would presume it's your JS butchering it. If you add a submit button and remove the $_POST['submit'] check, I would presume it would work.
If it indicates that the mail() is successful and still not received, that is not a PHP issue. That would be an issue with either the smtp not sending the mail, so you'd need to check the configured smtp error logs, or the receiver rejecting it. If it throws the false, that would indicate an issue with the smtp not accepting it for queue. I don't see an issue with the data you have here.
header('HTTP/1.1 420 Enhance Your Calm');