Please be warry the PHP
Mail() code is no longer a safe method as there has been evidence of hackers blacklisting your email address to a point where large providers such as Gmail and Yahoo consider this as spam and prevents user from sending anything.
PHPMailer has become very popular in has become more simple to use...
also remove unneccessary code such as the blank
please also validate your code on the php side such as checking for blank input fields and the correct characters for example the email has its own validate on but anyone can use a bogus email address so you need to send a request to check if the email address exists or the text field shouldnt be able to contain content such as
</>"' etc only text.
and simply validate the message to also not contain those html characters since thats what makes it prone to hacking unless your making an email related topic with those codes consider convert those elements into just visible text there is alot to consider when using php mail I know the frustration lol.
anyway a good start but try to avoid using php
mail() go for phpmailer and the other php coders.