MessageResources messages = getResources(request);
HttpSession session = request.getSession();
SendAdminMailForm samForm = (SendAdminMailForm) form;
User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
UserDAO dao = UserDAO.getInstance();
MessageProcessor mp = MessageProcessor.getInstance();
String mess = mp.prepareMessage(HtmlCodec.encode(samForm.getText()), 0,
messages);
StringBuffer siteUrl = new StringBuffer();
siteUrl.append(request.getServerName());
siteUrl.append(":");
siteUrl.append(request.getServerPort());
siteUrl.append(request.getContextPath());
siteUrl.append(Configurator.getInstance().get(
IConst.CONFIG.MODULE_PREFIX));
siteUrl.append("/");
/*
* {0} - login {1} - message text {2} - site url {3} - site name
*/
Object[] messArgs = new Object[] { "", mp.nl2br(mess),
siteUrl.toString(),
Configurator.getInstance().get(IConst.CONFIG.SITE_NAME) };
MailQueue queue = (MailQueue) session.getServletContext().getAttribute(
IConst.CONTEXT.MAIL_QUEUE);
try {