You should use ``drupal_mail()`` which already wraps those functions.