I use actual version of phpMailer (downloaded yesterday from github). It sends mails from my local computer (Win10, xampp 7.4.3) and can't send it from server (centOs7, nginx, php7). Both computers in one LAN behind the same firewall. I suspect php.ini configuration, but what should be configured exactly?
Thanks for any help.
The solution:
# sudo setsebool -P httpd_can_sendmail 1
The tracking of my search:
$mail = new PHPMailer\PHPMailer\PHPMailer();
$mail->SMTPDebug = 4;
SMTP ERROR: Failed to connect to server: Permission denied (13)
Hope this helps anybody else.