How to add PHPMailer Library in Drupal 9
This step should have been completed upon the installation of Drupal 8 for getting PHPMailer function
Install Composer
# curl -sS https://getcomposer.org/installer | php
Move Composer binary to usr bin path
# mv composer.phar /usr/bin/composer
Check Composer Version
# composer --version
Go to Drupal root Directory and execute
Drupal Installation Directory - /var/www/html