Class ReceivedMessage

java.lang.Object
com.codename1.backend.mail.ReceivedMessage

public final class ReceivedMessage extends Object
A mail as MimeParser read it: the decoded headers, the text and HTML bodies and the attachments.
  • Method Details

    • getFrom

      public String getFrom()
      The From header, decoded, or null.
      Returns:
      the sender
    • getTo

      public String getTo()
      The To header, decoded, or null.
      Returns:
      the recipients
    • getCc

      public String getCc()
      The Cc header, decoded, or null.
      Returns:
      the copied recipients
    • getSubject

      public String getSubject()
      The Subject header, decoded, or null.
      Returns:
      the subject
    • getDate

      public String getDate()
      The Date header as written, or null.
      Returns:
      the date header
    • getMessageId

      public String getMessageId()
      The Message-ID header, or null.
      Returns:
      the message id
    • header

      public String header(String name)
      The first header called name, any case, unfolded and with encoded words decoded; null when there is none.
      Parameters:
      name - the header name
      Returns:
      the value, or null
    • headers

      public List<String> headers(String name)
      Every header called name, in order.
      Parameters:
      name - the header name
      Returns:
      the values, empty when there is none
    • getText

      public String getText()
      The plain text body, or null.
      Returns:
      the text
    • getHtml

      public String getHtml()
      The HTML body, or null.
      Returns:
      the HTML
    • getAttachments

      public List<ReceivedMessage.Attachment> getAttachments()
      The attachments, and inline parts that are neither body.
      Returns:
      the attachments, never null
    • getRaw

      public byte[] getRaw()
      The message exactly as it was parsed.
      Returns:
      a copy of the raw bytes