swaks - Swiss Army Knife SMTP; Command line SMTP testing, including TLS and AUTH.
Highly recommended. Very useful.
http://jetmore.org/john/code/