欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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();

 

 

相关标签: Email