The validateEmail function isn't the right method for validating a text variable as an e-mail address.
For instance, it would return FALSE for "john@mycompany.consultant", since if restrict TLD to 4 alphanumeric characters.
The right method is through the filter_var() function:
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$emailErr = "Invalid email format";
}