There is an email validator in symfony that can be used in a form: http://symfony.com/doc/current/reference/constraints/Email.html
My question is: How can I use this val
My solution for symfony 3 was the following:
use Symfony\Component\Validator\Constraints\Email as EmailConstraint;
$email = 'someinvalidmail@invalid.asdf';
// ... in the action then call
$emailConstraint = new EmailConstraint();
$errors = $this->get('validator')->validate(
$email,
$emailConstraint
);
$mailInvalid = count($errors) > 0;