apt-get install libio-socket-ssl-perl libnet-ssleay-perl sendemail
usage:
sendemail -f fromuser@gmail.com -t touser@domain.com -u subject -m "message" -s smtp.gmail.com:587 -o tls=yes -xu gmailaccount@gmail.com -xp gmailpassword
If you don't want to specify your password in the command line (generally not a good thing to do), you can omit that parameter and sendemail will prompt you for the password... and display it on the screen, but at least it won't be in your command line history.