If your server has PEAR installed you can try using its Mail package.
require_once 'Mail.php';
$params = array('host' => 'mail.example.com',
'port' => '25'
'auth' => true,
'username' => 'user',
'password' => 'password');
$recipient = 'recipient@example.com'
$headers = array('From' => 'sender@example.com',
'To' => $recipient,
'Subject' => 'Test message',
'Message-ID' => '<' . uniqid('') . $params['host'] . '>');
$body = 'Message text';
$mail_object =& Mail::factory('smtp', $params);
if (!$mail_object->send($recipient, $headers, $body)) {
echo 'Failed';
} else {
echo 'Succeeded';
}