Various roles RPi can take as a server.
Sendmail used to be the standard option but nobody recommends it any longer, at least for RPi and public Internet access.
Newer options seem to be Postfix, Dovecot. DKIM to stop outgoing emails being treated as spam.
If making any changes to Postfix with postconf, make sure to run "service postfix reload".
Links