Sending email from twig template
You could create a simple plugin with just a Template Variable that sends the mail: https://craftcms.com/docs/plugins/variables

Not sure if I'd put this kind of logic in templates though.