From http://www.coderanch.com/t/586537/java/java/sample-code-java-mail-api