commons-email笔记
使用Apache Commons-email发送电子邮件
所需要的jar包
commons-emai-1.2.jarcommons-logging-1.1.1.jarmail.jar
如果JDK版本过低还需要
activation.jar
发送简单邮件
public void sendHtmlMail() throws Exception {HtmlEmail email = new HtmlEmail();email.setHostName("mail.fastunit.com");email.setAuthentication("support@fastunit.com", "***");email.setCharset("UTF-8");email.addTo("fastunit.com@hotmail.com");email.setFrom("support@fastunit.com", "support");email.setSubject("subject中文");email.setHtmlMsg("<b>msg中文</b>");email.send();}