For example, the following three packages are required for sending emails in Java.
Activation-1.1.jar,
Commons-email-1.1.jar,
Mail-1.4.jar
These three jar packages can be directly downloaded online.
Javamail 1.4.3
Http://www.oracle.com/technetwork/java/index-138643.html
JavaBeans activation framework 1.1.1
Http://www.oracle.com/technetwork/java/javase/downloads/index-135046.html
Apache-commons-Email
Http://commons.apache.org/email/download_email.cgi
Import Org. apache. commons. mail. emailexception; <br/> Import Org. apache. commons. mail. simpleemail; </P> <p> public class mailtest {<br/> Public static void main (string [] ARGs) {<br/> simpleemail email = new simpleemail (); <br/> email. settls (true); <br/> email. sethostname ("smtp.163.com"); <br/> email. setauthentication ("lichong_87@163.com", "*****"); // user name and password </P> <p> try {<br/> email. addto ("49937485@qq.com"); // recipient <br/> email. setfrom ("lichong_87@163.com"); // sender <br/> email. setsubject ("Java mail test"); // Title <br/> email. setcharset ("GBK"); <br/> email. setmsg ("just a simple send test. chinese "); // content <br/> email. send (); </P> <p >}catch (emailexception e) {<br/> E. printstacktrace (); <br/>}< br/>}