Few months ago I had a similar problem whilst developing on my local machine an application which involved sending automating email notifications. I have lost quite some time installing Sendmail on OSX and eventually I could not get it working right..
My approach was to use the PEAR Mail as a temporary replacement for php's native mail function. Basically you can define a function called send-mail (see code below) and, once you deploy your app on a server, you can possibly replace the calls to that function with calls to mail().
<?php
require_once 'Mail.php';
function send_mail($recipient,$subject,$body){
$host = "yourmailserver.net";
$username = "[email protected]";
$password = "password";
$port = 25;
$headers = array ('From' => "Your agent <[email protected]>",
'To' => $recipient,
'Subject' => $subject
);
$smtp = Mail::factory(
'smtp',
array ('host' => $host,
'auth' => true,
'port' => $port,
'username' => $username,
'password' => $password)
);
$smtp->send($recipient, $headers, $body);
}
?>