This handy function allows you to tell WP to send email. I’m using it to send emails requesting feedback on a customer service site. Its implementation is surprisingly simple.
<?php wp_mail( $to, $subject, $message, $headers, $attachments ); ?>
I created an action that hooked into save_post, and when the post (a support ticket) is updated to “closed” (a custom taxonomy), an email will be sent. It’s amazingly easy.