Assuming you're using PHP4, the mail() function works fine if you have your PHP.INI configured properly to point to an SMTP server. At least, that's been my experience thus far.
A useful little article on this by Julie Meloni (author of PHP Essentials, the 1st book I bought on PHP) can be had at
http://www.thickbook.com/extra/php_email.phtml
Don't know if it'll help you or not, but I found her explanation of mail() to be quite helpful. And as I said, be sure you have PHP.INI configured properly to point to an SMTP server;
e.g.
...
[mail function]
SMTP = smtp.yourdomain.com
; MODIFIED from 'localhost'
; for win32 only
sendmail_from = you@yourdomain.com
; MODIFIED from 'me@localhost.com'
; for win32 only
;sendmail_path = ;for unix only, may supply arguments as well
; (default is sendmail -t)
...
I found this tends to be the biggest problem most people have.