Did you check out the email module already?
https://marketplace.mendix.com/link/component/259
here is the module : https://marketplace.mendix.com/link/component/259
you have the doc here : https://docs.mendix.com/appstore/modules/email-with-templates