Send Email Via Comman Line

Here is a short explanation on how to send an email from the command line using sendEmail.  I will also explain a few of the problems that I encountered when attempting to do this in Ubuntu 8.04.

First I downloaded sendEmail through apt-get.  Then I tried running the following command with my correct information which should work with gmail:

sendEmail -f <FROM EMAIL> -t <TO EMAIL> -u <SUBJECT> -m <MESSAGE> -s <SERVER> -o tls=yes -xu <USERNAME> -xp <PASSWORD>

After running this command I encountered this:

ERROR => No TLS support!  SendEmail can't load required libraries. (try installing Net::SSLeay and IO::Socket::SSL)

Well what does this mean.  Doing a quick google search turned up some old archived forums that had the same problem, but still no solution.  Alright, then I will have to think on my own.  I knew that sendEmail was written in perl, so it had something to do with a perl library.  Doing "apt-cache search perl net ssleay" and "apt-cache search perl io socket ssl" came up with the proper perl libraries that I needed.  The following line is what is needed to install sendEmail with the required libraries in Ubuntu:

sudo apt-get install sendEmail libnet-ssleay-perl libio-socket-ssl-perl