After testing some email submissions using php, some errors were generated such as:
sendmail: Cannot open mail: 25
The solution was:
vim /etc/ssmtp/ssmtp.conf
mailhub=localhost
With that the sending using the php function started to work.
It would be nice for aaPanel to make this change automatically.
Quick fix:
sed -i 's/mailhub=mail/mailhub=localhost/g' /etc/ssmtp/ssmtp.conf