You need to use a mail server that is configured correctly. If you installed that server then you either need to go to a forum about that mail server or use a service like mailgun. It’s likely that mail from that server will not be delivered anyway.
This is not a Discourse problem.