Hello Captain07, how are you?
First, you will have to configure a web-api (or use other common services like mailchimp or sendinblue) that will handle the requests, and then you will have to use fetchRemote (server-side) to tell the API to send the email using the parameters sent by your mta server.
If you want to set up your own email service, I would recommend the PHP's own email sending, or if you are more familiar with javascript using node, you can use a module called "nodemailer" (there may be several other modules, but IHMO this is the best)
Anyway, there are several tutorials on the internet on how to create a mail server, it might be worth learning, good luck.