commons-email-1.3.1 博客分类: Email Email
程序员文章站
2024-02-16 15:41:40
...
下载
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("user@gmail.com");
email.setSubject("TestMail");
email.setMsg("This is a test mail ... :-)");
email.addTo("foo@bar.com");
email.send();