Not sure if it matters, but there should be a space after the “From:” in your $header variable, and there should be no space before the rn. Also, keep in mind that a local server is not going to be able to send out mail (at least without special set up or additional software). If you want to test this legitimately, make sure you’re running it on a live server.
Some times the mail() php function can be switched off as default by your hosting company in the php.ini file. One thing you can try to do is put a php.ini file in the same directory as the script and make sure that the mail() function is switched on in it. This sometimes might not work if the hosting company have set the server up to ignore other php.ini files.
One other thing you could do is put a php file on your server with just the phpinfo() function in it. It will list every function/extension that is switched on and off on your server, it can help solve a lot of issues.