Easiest is to use your upstream's SMTP server if possible, as suggested by a previous reply. If you can't / don't want to do that, then you certainly can install an outgoing only SMTP server. If you don't like sendmail, check out
Postfix, installation is easy on any Unix like system. Your scripts can then post all email to it, I tend to prefer
Mail::Sender over
Net::SMTP because of its higher level interface. Either way, posting emails via SMTP will save your web scripts the overhead of spawning a new process.