use of com.kyj.fx.voeditor.visual.framework.mail.SenderMailInfo in project Gargoyle by callakrsos.
the class MailUtil method sendMail.
/**
* 메일전송
*
* @Date 2015. 9. 13.
* @param mail
* 메일을 보내기 위한 정보가 담긴 객체
* @param mailContent
* 메일템플릿안에 들어갈 내용이 담기는 정보.
* @throws Exception
* @User KYJ
*/
public static boolean sendMail(List<Mail> mails, Map<String, Object> mailContent) throws Exception {
try {
Mailer bean = BeanUtil.getBean("mailer", Mailer.class);
VelocityContext merge = toVelocityContext(mailContent);
SenderMailInfo sender = BeanUtil.getBean("mailSenderInfo", SenderMailInfo.class);
bean.sendMail(sender, mails, merge);
} catch (Exception e) {
LOGGER.error(ValueUtil.toString(e));
return false;
}
return true;
}
use of com.kyj.fx.voeditor.visual.framework.mail.SenderMailInfo in project Gargoyle by callakrsos.
the class MailUtilTest method sendMailTest.
@Test
public void sendMailTest() throws Exception {
Mail mail = new Mail();
mail.setMailTo(new String[] { "", "" });
Map<String, Object> velocityContext = new HashMap<>();
velocityContext.put("seq", "667");
velocityContext.put("date", "2015-09-12");
velocityContext.put("numbers", "테스트번호입니다.");
SenderMailInfo senderMailInfo = new SenderMailInfo();
senderMailInfo.setSendUserId("");
senderMailInfo.setSendUserPassword("");
MailUtil.sendMail(senderMailInfo, mail, velocityContext);
}
Aggregations