This is a simple way to interact with email protocols.
Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
composer require samy/email
Please see Composer for more information.