You can simply use the PEAR mail package. It will allow you to create a server instance in which you can configure the protocol to use.
Example of use :
<?php
// Customize the variables below
$from = "SENDER NAME <USER@DOMAIN.COM>";
$to = "RECIPIENT NAME <EMAIL@DOMAINE2.COM>";
$subject = "SUBJECT";
$body = "YOUR MESSAGE";
$username = "USER@DOMAIN.COM";
$password = "EMAIL_PASSWORD";
// End of the modifications
require_once "Mail.php";
$headers = array('From'=>$from,'To'=>$to,'Subject'=>$subject);
$smtp = Mail::factory('smtp',array('host'=>'localhost','auth'=>true,'username'=>$username,'password'=>$password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message sent successfully!</p>");
}
?>