Home > SendMail

SendMail

SendMail is a project mainly written in Java, it's free.

This is mainly lifted from (URL over 2 lines here:) http://www.velocityreviews.com/forums/t141237-send-smtp-mail-using-javamail -with-gmail-account.html but with the main difference that the authentication details are not stored in the source, and are instead stored in a Java properties file. This is made slightly more tricky on the basis that you can't just implement an inner class, as otherwise the Properties file needs to be final, which defeats the purpose of it. You'll note that there is no properties file included in the Git project, because I'm not wanting to tell you my authentication details ;)

To get this to work, you will need to create a file called "sendmail.properties" in the root directory of the project. In it, you just need to put in a username and a password along these lines:

username = [email protected] password = SuperSecret

Once you've done that, change the 'sendTo' String array to contain your own email address and run the script.

Previous:xos