Ok I ran into some Java code this morning that I turned into a simple class to send mail through Gmail. I tested it and it seems work fine with my gmail account. It requires the javamail library which you can download from here:
http://java.sun.com/products/javamail/downloads/index.html Just unzip the mail.jar file and include that in your classpath when you compile and run it. To compile put the GmailSender.java and mail.jar files in the same directory and type this::
# javac -cp mail.jar;. GmailSender.java
Then to run it, do this:
# java -cp mail.jar;. GmailSender <yourgmailaddress> <yourgmailpassword> <to-emailaddr> "your subject here" filename.txt
filename.txt is a text file that has the body of the email you want to send. Currently it's set for HTML email, so you can put html code in there if you want.
Keep in mind, I'm not a programmer, I just know enough to be dangerous, so this can probably be written much more efficiently and safely, but it does work.