org.apache.mailet.Mail.setMessage()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中org.apache.mailet.Mail.setMessage()方法的一些代码示例,展示了Mail.setMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mail.setMessage()方法的具体详情如下:
包路径:org.apache.mailet.Mail
类名称:Mail
方法名:setMessage

Mail.setMessage介绍

[英]Sets the MimeMessage wrapped by this Mail instance.
[中]设置此邮件实例包装的mimessage。

代码示例

代码示例来源:origin: org.apache.james/james-server-file

mc.setMessage(new MimeMessageCopyOnWriteProxy(source));

代码示例来源:origin: org.apache.james/james-server-mail-file

mc.setMessage(new MimeMessageCopyOnWriteProxy(source));

代码示例来源:origin: org.apache.james/james-server-queue-file

try (ObjectInputStream oin = new ObjectInputStream(new FileInputStream(objectFile))) {
  final Mail mail = (Mail) oin.readObject();
  mail.setMessage(new MimeMessageCopyOnWriteProxy(new FileMimeMessageSource(msgFile)));
  MailQueueItem fileMailQueueItem = new MailQueueItem() {

代码示例来源:origin: org.apache.james/james-server-queue-jms

/**
 * Populat the given {@link Mail} instance with a {@link MimeMessage}. The
 * {@link MimeMessage} is read from the JMS Message. This implementation use
 * a {@link BytesMessage}
 *
 * @param message
 * @param mail
 * @throws MessagingException
 */
protected void populateMailMimeMessage(Message message, Mail mail) throws MessagingException, JMSException {
  if (message instanceof ObjectMessage) {
    mail.setMessage(new MimeMessageCopyOnWriteProxy(new MimeMessageObjectMessageSource((ObjectMessage) message)));
  } else {
    throw new MailQueueException("Not supported JMS Message received " + message);
  }
}

代码示例来源:origin: org.apache.james/apache-mailet-crypto

mail.setMessage(message);
} catch (Exception e) {
  throw new MessagingException(

代码示例来源:origin: org.apache.james/james-server-queue-activemq

@Override
protected void populateMailMimeMessage(Message message, Mail mail) throws MessagingException, JMSException {
  if (message instanceof BlobMessage) {
    try {
      BlobMessage blobMessage = (BlobMessage) message;
      try {
        // store URL and queueName for later usage
        mail.setAttribute(JAMES_BLOB_URL, blobMessage.getURL());
        mail.setAttribute(JAMES_QUEUE_NAME, queueName);
      } catch (MalformedURLException e) {
        // Ignore on error
        LOGGER.debug("Unable to get url from blobmessage for mail {}", mail.getName());
      }
      MimeMessageSource source = new MimeMessageBlobMessageSource(blobMessage);
      mail.setMessage(new MimeMessageCopyOnWriteProxy(source));
    
    } catch (JMSException e) {
      throw new MailQueueException("Unable to populate MimeMessage for mail " + mail.getName(), e);
    }
  } else {
    super.populateMailMimeMessage(message, mail);
  }
}

代码示例来源:origin: org.apache.james/apache-mailet-crypto

mail.setMessage(newMessage);

代码示例来源:origin: org.apache.james/apache-mailet-crypto

mail.setMessage(newMessage);
} catch (IOException e) {
  LOGGER.error("Error during the strip of the encrypted message", e);

代码示例来源:origin: org.nhind/gateway

mail.setMessage(result.getProcessedMessage().getMessage());

相关文章