sender.setPort(25);
sender.setUserName("damoqiongqiu");
sender.setPassWord("xiaotao015001024");
sender.setMailFrom("damoqiongqiu@126.com");
MailMessage mail1 = new MailMessage();
boolean mailSuccess=false;
try {
mail1.setMailFrom(sender.getMailFrom());
mail1.setMailTo(email);
mail1.setMaiSubject("来自忆唐的验证邮件");
String filePath = System.getProperty("web.home")+System.getProperty("regTplHtml");
String content=FileUtil.readAll(filePath);
content=StringUtil.format(content, new String[]{nickName,userName,validateCode});
mail1.setContent(content);
mail1.saveChanges();
mailSuccess=sender.send(mail1);
} catch (Exception e) {
log.error("发送验证邮件失败");
mailSuccess=false;
}