Are you running this on your local development machine, or a hosted server somewhere? Or more to the point, on whatever platform the code is running, is your email configured correctly?
I read on here that no-one really recommended using the PHP
mail() function because it's a bit unreliable, instead people talk about
Swiftmailer. Have a browse a few pages further down the forum, there are some similar questions recently with more comprehensive answers.
What does the
mail() function return after you have called it? I notice that you're not checking the result, it will return either
false to denote whether it was even possible to try to send the email.