Junzizhiai 2013-05-13
下载
http://commons.apache.org/proper/commons-email/download_email.cgi
使用
http://commons.apache.org/proper/commons-email/userguide.html
Email email =newSimpleEmail();
email.setHostName("smtp.googlemail.com");
email.setSmtpPort(465);
email.setAuthenticator(newDefaultAuthenticator("username","password"));
email.setSSLOnConnect(true);
email.setFrom("[email protected]");
email.setSubject("TestMail");
email.setMsg("This is a test mail ... :-)");
email.addTo("[email protected]");
email.send();