I had a hard time finding out how to make it work, and still don't know why it doesn't work.
But any way, when the
Use SMTP Authentication: (Almost always, yes)
is set to
No
as per my requirements, the mail test mail is not sent and is facing an error :
SMTP Error: Could not authenticate.
as a workaround I enclosed the 3 lines of users/helpers/helpers.php involved in SMTPAuth in the following if condition
if (strpos(strtoupper($results->useSMTPauth), "TRUE") !== false) {
$mail->SMTPAuth = $results->useSMTPauth; // Enable SMTP authentication
$mail->Username = $results->email_login; // SMTP username
$mail->Password = html_entity_decode($results->email_pass); // SMTP password
}