As good as that sounds, you'll need sendmail to finish things off.
CGI is just a path from http to the server, PERL can manipulate and format your data (Practical Extraction and Report Language), but sendmail still needs to send the message.
Don't know what type of application you are going to be developing, but if it is web based, may I humbly recomend you take a look at PHP?
Take a trawl around various computer language sites for arguments for PHP e.g. www.developer.com .
PHP4 and mySQL are a doddle to install on OSX.
Whichever way you go, I too recomend the O'Reilley books.