Index: lams_common/src/java/org/lamsfoundation/lams/util/Emailer.java =================================================================== diff -u -rc9ca11f026fc11b2e6d41b2e60494ed5f95884a0 -reb5c5f46b64a86127b7c871632172769fa0ec83f --- lams_common/src/java/org/lamsfoundation/lams/util/Emailer.java (.../Emailer.java) (revision c9ca11f026fc11b2e6d41b2e60494ed5f95884a0) +++ lams_common/src/java/org/lamsfoundation/lams/util/Emailer.java (.../Emailer.java) (revision eb5c5f46b64a86127b7c871632172769fa0ec83f) @@ -1,6 +1,7 @@ package org.lamsfoundation.lams.util; import java.io.UnsupportedEncodingException; +import java.util.Date; import java.util.Properties; import javax.activation.DataHandler; @@ -39,11 +40,11 @@ */ public static void sendFromSupportEmail(String subject, String to, String body, boolean isHtmlFormat) throws AddressException, MessagingException, UnsupportedEncodingException { - sendFromSupportEmail(subject, to, body, isHtmlFormat, null); + Emailer.sendFromSupportEmail(subject, to, body, isHtmlFormat, null); } - public static void sendFromSupportEmail(String subject, String to, String body, boolean isHtmlFormat, String attachmentFilename) - throws AddressException, MessagingException, UnsupportedEncodingException { + public static void sendFromSupportEmail(String subject, String to, String body, boolean isHtmlFormat, + String attachmentFilename) throws AddressException, MessagingException, UnsupportedEncodingException { String supportEmail = Configuration.get(ConfigurationKeys.LAMS_ADMIN_EMAIL); Emailer.send(subject, to, "", supportEmail, "", body, isHtmlFormat, attachmentFilename); } @@ -94,10 +95,10 @@ */ public static void send(String subject, String to, String toPerson, String from, String fromPerson, String body, boolean isHtmlFormat) throws AddressException, MessagingException, UnsupportedEncodingException { - - send(subject, to, toPerson, from, fromPerson, body, isHtmlFormat, null); + + Emailer.send(subject, to, toPerson, from, fromPerson, body, isHtmlFormat, null); } - + /** * Send email to recipients * @@ -116,17 +117,19 @@ * @param isHtmlFormat * whether the message is of HTML content-type or plain text * @param file - * file to attach + * file to attach */ public static void send(String subject, String to, String toPerson, String from, String fromPerson, String body, - boolean isHtmlFormat, String filename) throws AddressException, MessagingException, UnsupportedEncodingException { + boolean isHtmlFormat, String filename) + throws AddressException, MessagingException, UnsupportedEncodingException { Session session = Emailer.getMailSession(); MimeMessage message = new MimeMessage(session); message.setFrom(new InternetAddress(from, fromPerson)); message.addRecipient(RecipientType.TO, new InternetAddress(to, toPerson)); message.setSubject(subject, "UTF-8"); + message.setSentDate(new Date()); if (filename == null) { message.setText(body, "UTF-8");