I am trying to validate email then send the email if correct email. Below code is not working for me.
$errors = '';
$myemail = 'email@example.com
$errors .= "\n Error: all fields are required";
$name = $_POST['name'];
$email_address = $_POST['email'];
$message = $_POST['message'];
$errors .= "\n Error: Invalid email address";
mail("firstname.lastname@example.org", "$subject", $message, "From:" . $email);
echo "Thank you for using our mail form";
--i entered invalid email address but it cant verify that it is invalid. i was expecting error message. if valid email, then just send the email.