PHP mail()
uses sendmail
system, and most of the problems happens when it is not set up properly. Sometimes webhosters disable it outright.
Sometimes, i solved this problem by using an external library, PhpMailer, for example, and SMTP with a real mail account.
On a side note - never ever do this:
$fname = strip_tags(htmlentities($_POST['fname']));
$lname = strip_tags(htmlentities($_POST['lname']));
$name = $fname." ".$lname;
$email = strip_tags($_POST['email']);
$phone = strip_tags(htmlentities($_POST['phone']));
$address = strip_tags(htmlentities($_POST['address']));
$city = strip_tags(htmlentities($_POST['city']));
$state = strip_tags(htmlentities($_POST['state']));
$zip = strip_tags(htmlentities($_POST['zip']));
$country = strip_tags(htmlentities($_POST['country']));
$message = strip_tags(htmlentities($_POST['goals']));
It can be easily replaced by something like:
extract(
array_map(
function($elem) {
return strip_tags(html_entities($elem));
}, $_POST)
);