Ver originalif(filter_var($mail, FILTER_VALIDATE_EMAIL)) {
Ver originalif(filter_var(trim($mail), FILTER_VALIDATE_EMAIL)) {