How can I send email from application when one event happen? Which function can I use?

Thank you!

Best Regards,

Kevin Shen