The answer would be almost the same as my recent answer:
Contact Form not sending senders email address[
^].
In your case, you need to checkup your data and debug the code. You need to check up all the data which come through
$_POST
by debugging or any kind of service logging. I'm not sure that first
isset
condition evaluates to true; probably not; it would explain the rest. Why are you doing this test? You can use any other form field. Why do you think that the name of the submit button is passed through HTTP request? it would not make any sense.
Also, check up all the SMTP setting. Make sure that the message is passed through SMTP if you use some available mail client with the same options and authentication data.
—SA