If you require zendframework/zend-mail
via composer, there is a suggestion for zendframework/zend-validator
. The validator is required if you want to send any emails.
So update your composer.json, add zend-validator as package and run composer update
. This will load the Validator component so you can run your code.