PHPMailer is one of the most used PHP Mailing libraries. Millions of websites use it all over the world. It's opensource, meaning that you can freely use it in any of your projects.
Setup is quite easy, and there are hundreds of examples available and has many features that are not available with the simple mail() PHP function.
One of those features is the ability to use SMTP authentication. SMTP authentication is used to verify that your script has the authority to send emails.
If you receive an error message that SMTP authentication has failed, you might think that you have inadvertently entered the wrong credentials (username and password), and the server is rejecting it. But what if you know for a fact that you did use the correct credentials? What would you do? Not to worry, there are options or settings you can set to add additional debug output. For example:
//Enable SMTP debugging.
$mail->SMTPDebug = 3;
With SMTPDebug set to 3, your output might then look something like this:
Warning: stream_select() has been disabled for security reasons
There is a PHP function called stream_select() that is required for PHPMailer to work correctly. But, like many PHP functions, this can be disabled within a php.ini file using the disabled_functions option.
The error is stating that you may have this function disabled. Try removing that function from disabled_functions and go back to your script and rerun it to see if that solves the issue.
Of course, this is just one possible issue. Setting the SMTPDebug value higher though should be able to help you understand why PHPMailer isn't working properly.