Use MailManager instead of the depreceted drupal_mail() function.