标签:java os io html new htm ad ef
private static void sendMail(String mail, String mailContext) {
try {
String context = FileUtil.getFileContent("lostpassEmail.html");
HtmlEmail email = new HtmlEmail();
email.setHostName("smtp.163.com");
email.setSmtpPort(25);
email.setAuthenticator(new DefaultAuthenticator("baichuanyu@163.com", "bai123yu"));
email.setSSLOnConnect(false);
email.setFrom("baichuanyu@163.com");
email.setSubject("密码找回");
email.setHtmlMsg(context);
email.addTo(mail);
email.send();
} catch (Exception e) {
e.printStackTrace();
}
}
标签:java os io html new htm ad ef
原文地址:http://www.cnblogs.com/Wen-yu-jing/p/3919814.html