A simple alternative is to install ssmtp. On ubuntu:
$ sudo aptitude install ssmtpand then edit /etc/ssmtp/ssmtp.conf. Here is an example configuration that uses a Gmail account for relaying:
# Config file for sSMTP sendmail
# The full hostname of this machine
# Allow users to set their own From: address?
You send mail using /usr/sbin/ssmtp just as you would with sendmail, but without any of the sendmail.cf configuration business.
As a bonus, ssmtp sets up symlinks for /usr/lib/sendmail and /usr/sbin/sendmail such that if you have an existing script that calls sendmail it will probably work as is one a system with ssmtp installed.
Here is a ssmtp man page.