Here's my opinion of the correct way to accomplish this, and it's not significantly hard if all you want to do is sent out mail for php via your ISP's SMTP server.
Ensure you have an MTA installed on your ubuntu instance, my preference is postfix, but you can use a different one (exim, qmail are both fine), however some of these instructions will need to be adapted/separately researched if you do.
# apt-get install postfix postfix-doc
Then we'll need to tell it how to send out mail to the internet using you're isp's smtp server, you should already have this info, it may be referred to as your Outgoing mail server, replace smtp.isp.net with this information.
# postconf -e relayhost=smtp.isp.net
This will adjust your postfix main.cf configuration file to enable your mail server to send to the outside world.
Now we need to edit php.ini to tell it the location of the sendmail binary, this binary is not actually a sendmail MTA but a wrapper for postfix that provides a known consistent sendmail-like interface.
By default in debian/ubuntu the postfix sendmail binary is in
# whereis sendmail
Will assist you to locate it.
Now that we have the full path for the sendmail binary, we can edit the php.ini file, it should be located in /etc/php5/apache2/php.ini, open it in whatever editor you're familiar with.
Locate the section marked
[mail function] and comment out the
sendmail_path and add the full path to the sendmail binary directly after the = sign.
Then issue this
# /etc/init.d/postfix restart
# /etc/init.d/apache2 restart
Then try sending a message from a php script, if it fails check the /var/log/mail.info file.