request.setAttribute("needAuth", needAuth);
return "activity/sendemail";
}
// 发送邮件
boolean flag = false;
Mail mail = new Mail(email, password);
try {
if ("add".equals(op)) {
mail.send(email, toAddresses, null, "活动通知", EmailTemplates
.buildAddContent(act.getTime(), act.getTitle(), act
.getId()));
} else if ("edit".equals(op)) {
mail.send(email, toAddresses, null, "活动修改通知", EmailTemplates
.buildEditContent(act.getTime(), act.getTitle(),
EmailConfig.getValue("editContent"), act
.getId()));
} else if ("cancel".equals(op)) {
mail.send(email, toAddresses, null, "活动取消通知", EmailTemplates
.buildCancelContent(act.getTime(), act.getTitle()));
}
flag = true;
} catch (Exception e) {
e.printStackTrace();