$email = 'john.doe@example.com'; $validator = new \Cake\Validation\Validator(); $validator->requirePresence('email') ->notEmpty('email', 'Please fill out this field') ->email('email', 'Please enter a valid email address'); $errors = $validator->validate(['email' => $email]); if (empty($errors)) { echo 'Valid email address'; } else { echo 'Invalid email address'; }In the above example, we create a new instance of the CakePHP validator class and use the email method to validate the email address. We also use the requirePresence and notEmpty methods to ensure that the email field is not empty. Package library: CakePHP framework (cakephp/cakephp)