Theoretically is very different than IRL
Discourse does not support sending through API and this has been discussed earlier multiple times. This won’t be implemented unless there is a single, open source standard to send emails via API.
Individual developers may make plug in for discourse but it won’t really help in any way as email is required at the time of first run in order for admin to recieve the activation email.
Though it may be possible to install a plugin at that phase, it is neither recommended nor is documented anywhere by discourse in their official install guides.
I highly doubt someone is going to work on
A. Creating a plugin
B. Writing a guide to compile discourse with their plugin
C. Maintain a plugin for discourse for as long as discourse exists and the API standard doesn’t.
That too Just to add a functionality that is product specific and isn’t reliable.
One solution can be to run something like a local smtp2api script that takes all details from the SMTP and then sends it via API. That still would require a lot of effort and time.