What platform are you running this on?
The mail() function will send email via the server specified in php.ini
On a *nix box this usually set to go via sendmail
On a windows server you need to configure SMTP (I think).
I host my sites on Linux but develop on a WAMP setup so I can only test email on the live server, until I can figure out how to get email to work on windows