How to use different mail interfaces (Mail System)?
For D7 you can define a custom mail system using the $conf['mail_system']

$conf['mail_system'] = array('mycustom_module_thekey' =&gt; 'MyCustomEmailSystem');


Then you can use the drupal_mail function

drupal_mail('mycustom_module', 'thekey', $email, language_default(), $params, $from);