Well, generally you need 2 different programs regardless. Usually an SMTP server for accepting and storing emails and a IMAP server for clients to connect to and read stored emails.

For the parent post, you configure an outgoing SMTP relay

Iirc called smarthost in postfix