I've seen this style of form processing code a lot recently. I don't know if it comes up on the top web searches or if Instructors are actively using this in courses. This style of coding, with discrete variables and same blocks of code, repeated for each different form field, produces a wall of repetitive, error prone, logic, making it hard to see what you are really doing (cannot see the forest for the trees problem.) You are spending a majority of your time beating on a keyboard, typing/copy/pasting the same things over and over, rather than concentrating on the logic and program flow you need, to accomplish the task.
In addition to the logic error, where not all of the form processing code is inside the if(){...} conditional statement, you have a 'Subject' field in the form that is not being used in the form processing code. Doing the following will help make sure that any form field gets processed, or if you don't want the field at all, removing it from the design will be easy, and since this will reduce the amount of code that exists, it will make seeing what your program logic actually is doing, easier.
While the following sounds like an advanced programming topic, all it requires is understanding array variables (a variable that has more than one dimension), a few of php's array functions/loops, and a little indirect thinking. If you have more than about 2-3 of anything in programming, you need to dynamically process the data or produce the output as a set, using a data driven design. This means defining a data structure somewhere (array, database table) that tells your code what to do. The code then becomes simple and general purpose since it only needs to know how to do each different thing, not know specifically what to do to each piece of data.
If you had an array like the following -
$fields = array();
// the main array key/index is the field name, the array holds settings that define things about each field
// 'label' is used to produce messages and could be used as the label for the form field, if you dynamically produce the form
// 'required' is used by the logic to check if the field is required to be a non-empty value
// 'email' is used by the logic if the field should be added to the email body
$fields['name'] = array('label'=>'Name','required'=>'y','email'=>'y');
$fields['email'] = array('label'=>'Email','required'=>'y','email'=>'y');
$fields['phone'] = array('label'=>'Phone Number','required'=>'y','email'=>'y');
$fields['message'] = array('label'=>'Message','required'=>'y','email'=>'y');
$fields['human'] = array('label'=>'Sum','required'=>'y');
You could simply loop over this array in the form processing code and use the 'required' setting to control if a an empty form field produces a "Please enter the ..." message (the 'label' value is used as the ... in the message.) For example, like this -
// check all required fields
// note: $data is an array that holds a copy of all the trimmed $_POST data. $errors is an array that you put error messages into. These arrays replace the lists of discrete variables in the current code.
foreach($fields as $field=>$arr)
{
if(isset($arr['required']) && $arr['required'] == 'y' && $data[$field] == '')
{
$errors[$field] = "Please enter the {$arr['label']}.";
}
}
This code will work no matter how many form fields there are and you don't need to touch this code when the number of form fields gets changed. You can expand upon this method to handle other specific validation for any field or you can continue to use discrete logic for field(s), which ever is simpler for what you are doing.
If you expand upon this method and add a 'type'=>'text' or 'type'=>'textarea' entry to the defining array, you can now dynamically produce the form fields, by simply looping over this array. You would have a switch/case statement to produce the different syntax for the different type of fields (BTW, you have an error in your textarea field. There is no value='...' attribute for a textarea. You output any existing value between the <textarea>existing content goes here...</textarea> tags). This will mean that your form will only have the fields that you have defined and that all the fields in the form will be processed by the processing code. Adding or removing a field will be easy, just add or remove the entry in the defining array.