if (mimeMessage.getSentDate() == null) { mimeMessage.setSentDate(new Date());
throw new MessagingException("Message failed RFC-2822 validation: No Sender"); Date sentDate = originalMessage.getSentDate(); if (sentDate == null ) { attributes.put(EMAIL_HEADER_RECV_DATE, originalMessage.getReceivedDate().toString()); if (originalMessage.getSentDate() != null) { attributes.put(EMAIL_HEADER_SENT_DATE, originalMessage.getSentDate().toString());
throw new MessagingException("Message failed RFC-2822 validation: No Sender"); Date sentDate = originalMessage.getSentDate(); if (sentDate == null) {
if (mimeMessage.getSentDate() == null) { mimeMessage.setSentDate(new Date());
assertEquals("us@mail.org", ((InternetAddress) bccs.get(0)).getAddress()); assertEquals("them@mail.org", ((InternetAddress) bccs.get(1)).getAddress()); assertEquals(sentDate.getTime(), sentMessage.getSentDate().getTime()); assertEquals("my subject", sentMessage.getSubject()); assertEquals("my text", sentMessage.getContent());
/** * Get the SentDate. */ public Date getSentDate() throws MessagingException { checkExpunged(); if (bodyLoaded) return super.getSentDate(); loadEnvelope(); if (envelope.date == null) return null; else return new Date(envelope.date.getTime()); }
/** * Get the SentDate. */ @Override public Date getSentDate() throws MessagingException { checkExpunged(); if (bodyLoaded) return super.getSentDate(); loadEnvelope(); if (envelope.date == null) return null; else return new Date(envelope.date.getTime()); }
if (this.message.getSentDate() == null)
private long calculateBestDate(final MimeMessage message, final File file) { try { return message.getSentDate().getTime(); } catch (final Exception e) { return file.lastModified(); } }
private long calculateBestDate(final MimeMessage message, final File file) { try { return message.getSentDate().getTime(); } catch (final Exception e) { return file.lastModified(); } }
public static String getSentDate(MimeMessage msg, String pattern) throws MessagingException { Date receivedDate = msg.getSentDate(); if (receivedDate == null) return ""; if (pattern == null || "".equals(pattern)) pattern = "yyyy-MM-dd HH:mm:ss E"; return new SimpleDateFormat(pattern).format(receivedDate); }
/** * @see javax.mail.Message#getSentDate() */ public Date getSentDate() throws MessagingException { return getWrappedMessage().getSentDate(); }
/** * Get the SentDate. */ @Override public Date getSentDate() throws MessagingException { checkExpunged(); if (bodyLoaded) return super.getSentDate(); loadEnvelope(); if (envelope.date == null) return null; else return new Date(envelope.date.getTime()); }
/** * Get the SentDate. */ @Override public Date getSentDate() throws MessagingException { checkExpunged(); if (bodyLoaded) return super.getSentDate(); loadEnvelope(); if (envelope.date == null) return null; else return new Date(envelope.date.getTime()); }
/** * Get the SentDate. */ @Override public Date getSentDate() throws MessagingException { checkExpunged(); if (bodyLoaded) return super.getSentDate(); loadEnvelope(); if (envelope.date == null) return null; else return new Date(envelope.date.getTime()); }
/** * Get the SentDate. */ @Override public Date getSentDate() throws MessagingException { checkExpunged(); if (bodyLoaded) return super.getSentDate(); loadEnvelope(); if (envelope.date == null) return null; else return new Date(envelope.date.getTime()); }
/** * Responsible for filling inc/quoted-mail.vm template * @param velocityContext context to put template-vars in * @param msgToRespondTo message to repspond to * @throws MessagingException * @throws IOException */ private void putQuotedMail(VelocityContext velocityContext, MimeMessage msgToRespondTo) throws MessagingException, IOException { String respondToMailAddress = MailContentExtractor.getFromAddressString(msgToRespondTo); velocityContext.put("respondAddress", respondToMailAddress); velocityContext.put("sentDate", msgToRespondTo.getSentDate()); String mailText = MailContentExtractor.getMailText(msgToRespondTo); if (mailText != null) { velocityContext.put("respondMessage", mailText.replaceAll("\\n", "\n" + QUOTE_CHAR)); } }
private void doSend(MimeMessage mimeMessage, Address[] recipients) throws MessagingException { if (mimeMessage.getSentDate() == null) { mimeMessage.setSentDate(new Date()); } String messageId = mimeMessage.getMessageID(); mimeMessage.saveChanges(); if (messageId != null) { // Preserve explicitly specified message id... mimeMessage.setHeader(HEADER_MESSAGE_ID, messageId); } delegate.sendMessage(mimeMessage, recipients); }
private void doSend(MimeMessage mimeMessage, Address[] recipients) throws MessagingException { if (mimeMessage.getSentDate() == null) { mimeMessage.setSentDate(new Date()); } String messageId = mimeMessage.getMessageID(); mimeMessage.saveChanges(); if (messageId != null) { // Preserve explicitly specified message id... mimeMessage.setHeader(HEADER_MESSAGE_ID, messageId); } delegate.sendMessage(mimeMessage, recipients); }
public Timestamp getSentDate() { MimeMessage message = getMessage(); try { return UtilDateTime.toTimestamp(message.getSentDate()); } catch (MessagingException e) { Debug.logError(e, module); return null; } }