Error sending email

am getting the following error while trying to send email messages from a campaign:
Error sending email to xxx@yyy.zzz SMTP connect() failed. Troubleshooting · PHPMailer/PHPMailer Wiki · GitHub

Before activating the campaign I have successfully sent an email message through the following php script from the same server that hosts phplist:

$to = ‘xxx@yyy.zzz’;
$sub = ‘message’;
$msg = ‘Nulla porttitor accumsan tincidunt.’;
$hes = array(
‘From’ => ‘aaa@bbb.ccc’,
‘Reply-To’ => ‘aaa@bbb.ccc’,
‘X-Mailer’ => ‘PHP’,
‘Content-Type’ => ‘text/html; charset=UTF-8’
);
header(“Access-Control-Allow-Origin: *”);
if ( mail($to, $sub, $msg, $hes) ) {
echo $msg;
}

Therefore php mail() function works.

So I left unchanged the existing settings in config.php:

define(‘PHPMAILERHOST’, ‘localhost’);
define(‘PHPMAILERPORT’,2500);
define(‘PHPMAILER_SECURE’,false);

and of course:

define(‘TEST’, 0);

Is there anything left to do?

Solved by commenting the following three lines:

// define(‘PHPMAILERHOST’, ‘localhost’);
// define(‘PHPMAILERPORT’,2500);
// define(‘PHPMAILER_SECURE’,false);