Ciao Matteo,
grazie della tua risposta.
La versione PHP dell'attuale server (dove tutto funziona correttamente) è PHP 5.4.45, ecco perché ho scritto vecchio.
Sul nuovo server (dove appunto non funziona l'invio delle mail), abbiamo installato PHP 7.0.19-1 (cli) e debian 9.
Questo è il messaggio completo abilitando il debugging come sviluppatore: (ho sostituito il dominio con la parola "dominio")
#####################################################################################################
2017-10-26 06:52:32 Connection: opening to ssl://mail.dominio:25, timeout=300, options=array (
)
2017-10-26 06:52:32 Connection: opened
2017-10-26 06:52:32 SMTP -> get_lines(): $data is ""
2017-10-26 06:52:32 SMTP -> get_lines(): $str is "220 dominio ESMTP CommuniGate Pro 6.1.17 is glad to see you!
"
2017-10-26 06:52:32 SERVER -> CLIENT: 220 dominio ESMTP CommuniGate Pro 6.1.17 is glad to see you!
2017-10-26 06:52:32 CLIENT -> SERVER: EHLO dominiodellapiattaforma
2017-10-26 06:52:32 SMTP -> get_lines(): $data is ""
2017-10-26 06:52:32 SMTP -> get_lines(): $str is "250-dominio is pleased to meet you
"
2017-10-26 06:52:32 SMTP -> get_lines(): $data is "250-dominio is pleased to meet you
"
2017-10-26 06:52:32 SMTP -> get_lines(): $str is "250-DSN
"
2017-10-26 06:52:32 SMTP -> get_lines(): $data is "250-dominio is pleased to meet you
250-DSN
"
2017-10-26 06:52:32 SMTP -> get_lines(): $str is "250-SIZE 16384000
"
2017-10-26 06:52:32 SMTP -> get_lines(): $data is "250-dominio is pleased to meet you
250-DSN
250-SIZE 16384000
"
2017-10-26 06:52:32 SMTP -> get_lines(): $str is "250-ETRN
"
2017-10-26 06:52:32 SMTP -> get_lines(): $data is "250-dominio is pleased to meet you
250-DSN
250-SIZE 16384000
250-ETRN
"
2017-10-26 06:52:32 SMTP -> get_lines(): $str is "250-TURN
"
2017-10-26 06:52:32 SMTP -> get_lines(): $data is "250-dominio is pleased to meet you
250-DSN
250-SIZE 16384000
250-ETRN
250-TURN
"
2017-10-26 06:52:32 SMTP -> get_lines(): $str is "250-ATRN
"
2017-10-26 06:52:32 SMTP -> get_lines(): $data is "250-dominio is pleased to meet you
250-DSN
250-SIZE 16384000
250-ETRN
250-TURN
250-ATRN
"
2017-10-26 06:52:32 SMTP -> get_lines(): $str is "250-NO-SOLICITING
"
2017-10-26 06:52:32 SMTP -> get_lines(): $data is "250-dominio is pleased to meet you
250-DSN
250-SIZE 16384000
250-ETRN
250-TURN
250-ATRN
250-NO-SOLICITING
"
2017-10-26 06:52:32 SMTP -> get_lines(): $str is "250-HELP
"
2017-10-26 06:52:32 SMTP -> get_lines(): $data is "250-dominio is pleased to meet you
250-DSN
250-SIZE 16384000
250-ETRN
250-TURN
250-ATRN
250-NO-SOLICITING
250-HELP
"
2017-10-26 06:52:32 SMTP -> get_lines(): $str is "250-PIPELINING
"
2017-10-26 06:52:32 SMTP -> get_lines(): $data is "250-dominio is pleased to meet you
250-DSN
250-SIZE 16384000
250-ETRN
250-TURN
250-ATRN
250-NO-SOLICITING
250-HELP
250-PIPELINING
"
2017-10-26 06:52:32 SMTP -> get_lines(): $str is "250 EHLO
"
2017-10-26 06:52:32 SERVER -> CLIENT: 250-dominio is pleased to meet you
250-DSN
250-SIZE 16384000
250-ETRN
250-TURN
250-ATRN
250-NO-SOLICITING
250-HELP
250-PIPELINING
250 EHLO
2017-10-26 06:52:32 SMTP Error: Could not authenticate.
2017-10-26 06:52:32 CLIENT -> SERVER: QUIT
2017-10-26 06:52:32 SMTP -> get_lines(): $data is ""
2017-10-26 06:52:32 SMTP -> get_lines(): $str is "221 dominio CommuniGate Pro SMTP closing connection
"
2017-10-26 06:52:32 SERVER -> CLIENT: 221 dominio CommuniGate Pro SMTP closing connection
2017-10-26 06:52:32 Connection: closed
2017-10-26 06:52:32 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
#####################################################################################################
Ho letto questo tuo post ( https://moodle.org/mod/forum/discuss.php?d=324719 ) Pensavo di aver risolto anche io ma ho visto che con l'aggiornamento, il codice è stato aggiornato.
Grazie per il supporto.
Gio