WordPress admin area not sending mail (but works with WP Mail SMTP, Test Mail, and PHP mail() function)

I found the issue, had to edit /etc/php/8.3/cli/php.ini file, by adding/editing following lines :

[mail function]
; For Win32 only.
; https://php.net/smtp
#SMTP = localhost
SMTP = mysmtpserver.domain
; https://php.net/smtp-port
smtp_port = 25
username = myusername
password = mypassword
sendmail_from = [email protected]

Then a service nginx restart.

I still don’t understand why PHP is able to send mails through mail() function, but WordPress need the php.ini file to be configured…
Anyway, hope this helps !

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)