Here’s a code snippet that shows you how to use the drupal_mail function to send an email. First define a callback function that will handle the creation of the message. NOTE: this function must end with “_mail”
Now we can use this callback function in our code:
More information about drupal_mail can be found here. NOTE: if you’re going to send an email to a registered user, you should use the data found in $user for the language and email address.