Creating the pdf is described here: https://docs.mendix.com/refguide/creating-your-own-documents
For sending mail there are several options. I created this one: Marketplace-module EmailService, https://marketplace.mendix.com/link/component/117934 having only a very small footprint in your app.