I use this script to test webapps using mail with this little php script saved as /usr/sbin/sendmail :
#!/usr/bin/php
<?php
//====================================================
// Program : Fake send mail
// Author : pouletfou at gmail
// Description : save this file as /usr/sbin/sendmail
// and you can test your PHP applications using mail
// by looking at the /tmp/fakesendmail.log files.
//====================================================
define('LOGFILE','/tmp/fakesendmail.log');
$log = fopen (LOGFILE,'a+');
fwrite($log,"\n".implode(' ',$argv).
" called on : ".date('Y-m-d H:i:s')."\n");
fwrite($log,file_get_contents("php://stdin"));
fwrite($log,
"\n===========================================================\n");
fclose($log);
?>