if (TTL == -1) {TTL = 120;} // 5 days expiration by default
Timestamp timeToLive = null;
Calendar today = GregorianCalendar.getInstance();
today.add(Calendar.HOUR_OF_DAY, TTL);
timeToLive = new Timestamp(today.getTime().getTime());
String messageId = service.send(messageKey, fromMail, toMail, question, answer, timeToLive, version);
response.getWriter().write(messageId);
return;
}
}
throw new ServletException("Access Denied");