Interface MailMessage

    • Method Detail

      • getMessageId

        java.lang.String getMessageId()
        Returns:
        the message id as string
        Since:
        10.0.16
      • getFromAddress

        javax.mail.internet.InternetAddress getFromAddress()
        Returns:
        the sender address of the message
        Since:
        10.0.42
      • getSubject

        java.lang.String getSubject()
        Returns:
        the subject as string
        Since:
        10.0.16
      • getText

        java.lang.String getText()
        Returns:
        the plain text of the message as string
        Since:
        10.0.16
      • getHtml

        java.lang.String getHtml()
        Returns:
        the html text of the message as string
        Since:
        10.0.16
      • getAttachments

        java.util.Set<MessageAttachmentDataSource> getAttachments()
        Returns:
        a Set of all attachments of the message
        Since:
        11.0
      • getHeader

        java.lang.String[] getHeader​(java.lang.String name)
        Parameters:
        name - the name of the header
        Returns:
        array of decoded headers for the given name
        Since:
        10.0.142
      • writeTo

        void writeTo​(java.io.OutputStream outputStream)
              throws java.io.IOException,
                     javax.mail.MessagingException
        Output the underlying message as an RFC 822 format stream. Example code to obtain a MimeMessage instance: try { java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream(16384); mailMessage.writeTo(out); javax.mail.internet.MimeMessage m = new javax.mail.internet.MimeMessage((javax.mail.Session)null, new java.io.ByteArrayInputStream(out.toByteArray())); // do something with the MimeMessage; } catch (java.io.IOException | javax.mail.MessagingException e) {}
        Parameters:
        outputStream - the OutputStream to write the message data
        Throws:
        java.io.IOException - if an error occurs writing to the stream
        javax.mail.MessagingException - if an error occurs fetching the data to be written