For an integrated and full featured mail server configuration it's recommended to install vmail-stack:
https://git.stack-source.com/msb/vmail-stack
If you just want a minimal smtp mail server for getting automated emails (cron, website contact forms, etc.) off the server you can install and configure exim4-daemon-light with these commands:
```
apt -y install exim4-daemon-light mailutils
sed -i "s|dc_eximconfig_configtype='local'|dc_eximconfig_configtype='internet'|g" /etc/exim4/update-exim4.conf.conf