Simple Java Mail is made of, basically, three things:
Mail
class with simple methods like setSubject()
and addAttachment()
.CliMailer
class to make sending mail with the command-line a very easy task.Command-line usage (with SMTP authentication and attachments):
java -jar mailer.jar --from your-email@server.com --subject "Some news for you" --message "Sending mail can be simpler" --to recipient@server.com --to other-recipient@server.com -bcc copy@server.com --attach file.txt --attach other_file.txt --server smtp.server.com --username myself --password foobar
Code usage:
Mail.setServerName("smtp.server.com"); Mail.setSMTPAuthentication("myself", "foobar"); Mail m = new Mail(); m.setFrom("your-email@server.com"); m.setSubject("Some news for you"); m.setMessage("Sending mail can be simpler"); m.addTo("recipient@server.com"); m.addTo("other-recipient@server.com"); m.addBcc("copy@server.com"); m.addAttachment("file.txt"); m.addAttachment("other_file.txt"); m.send(true);
Download Simple Java Mail API files
To join this project, please contact the project administrators of this project, as shown on the project summary page.
Source code for this project may be available as downloads or through one of the SCM repositories used by the project, as accessible from the project develop page.
If you are a web page developer interested in this project, please consider reaching out to the project admin (per the "Join this project" section, above) to offer your assistance.
©Copyright 1999-2010 - Geeknet, Inc., All Rights Reserved