该项目是Apache的Commons子项目下的一个邮件客户端组件,它是基于JavaMail的,大大简化了邮件的收发操作。
示例代码:
Email email = new SimpleEmail(); email.setHostName("smtp.googlemail.com"); email.setSmtpPort(465); email.setAuthenticator(new DefaultAuthenticator("username", "password")); email.setSSLOnConnect(true); email.setFrom("user@gmail.com"); email.setSubject("TestMail"); email.setMsg("This is a test mail ... :-)"); email.addTo("foo@bar.com"); email.send();
JavaDoc: http://commons.apache.org/email/apidocs/index.html