It's 100% open source, there's a very nice Docker-based install. You can host it yourself on AWS or Digital Ocean for very little money.
Make a free Mailgun account and put your credentials into the Discourse installer and delivery is free up to 10,000 messages.