Try this site:
http://sourcelibrary.org/2011/08/29/how-to-set-up-the-php-mail-function-on-a-ubuntu-linux-lamp-server/

I followed the steps, and it worked for me. You have to have LAMP installed...