Class Message

java.lang.Object
com.independentsoft.email.mime.Message

public class Message extends Object
Class Message.
  • Constructor Details

    • Message

      public Message()
      Initializes a new instance of the Message class.
    • Message

      public Message(String filePath) throws IOException
      Initializes a new instance of the Message class.
      Parameters:
      filePath - The file path.
      Throws:
      IOException - if an I/O error occurs.
    • Message

      public Message(InputStream stream) throws IOException
      Initializes a new instance of the Message class.
      Parameters:
      stream - The stream.
      Throws:
      IOException - if an I/O error occurs.
    • Message

      public Message(byte[] buffer)
      Initializes a new instance of the Message class.
      Parameters:
      buffer - The buffer.
  • Method Details

    • open

      public void open(String filePath) throws IOException
      Opens the specified file path.
      Parameters:
      filePath - The file path.
      Throws:
      IOException - if an I/O error occurs.
    • open

      public void open(InputStream stream) throws IOException
      Opens the specified stream.
      Parameters:
      stream - The stream.
      Throws:
      IOException - if an I/O error occurs.
    • open

      public void open(byte[] buffer)
      Opens the specified buffer.
      Parameters:
      buffer - The buffer.
    • getAttachments

      public Attachment[] getAttachments()
      Gets the attachments.
      Returns:
      Attachment array.
    • getAttachments

      public Attachment[] getAttachments(boolean includeEmbedded)
      Gets the attachments.
      Parameters:
      includeEmbedded - if set to true, include embedded.
      Returns:
      Attachment array.
    • getFileName

      public String getFileName()
      Gets the name of the file.
      Returns:
      The file name.
    • save

      public void save(OutputStream stream) throws IOException
      Saves the specified stream.
      Parameters:
      stream - The stream.
      Throws:
      IOException - if an I/O error occurs.
    • save

      public void save(String filePath) throws IOException
      Saves this message to the specified file.
      Parameters:
      filePath - File path.
      Throws:
      IOException - if an I/O error occurs.
    • save

      public void save(String filePath, boolean overwrite) throws IOException
      Saves this message to the specified file.
      Parameters:
      filePath - File path.
      overwrite - True to overwrite existing file, otherwise false.
      Throws:
      IOException - if an I/O error occurs.
    • getBytes

      public byte[] getBytes()
      Gets the bytes.
      Returns:
      The bytes.
    • getStream

      public InputStream getStream()
      Gets the stream.
      Returns:
      Stream.
    • toString

      public String toString()
      Returns a String that represents this instance.
      Overrides:
      toString in class Object
      Returns:
      A String that represents this instance.
    • getHeaders

      public HeaderList getHeaders()
      Gets the headers.
      Returns:
      The headers.
    • getBodyParts

      public BodyPartList getBodyParts()
      Gets the body parts.
      Returns:
      The body parts.
    • getBody

      public String getBody()
      Gets the body.
      Returns:
      The body.
    • setBody

      public void setBody(String body)
      Sets the body.
      Parameters:
      body - The body.
    • getEmbeddedMessage

      public Message getEmbeddedMessage()
      Gets the embedded message.
      Returns:
      The embedded message.
    • setEmbeddedMessage

      public void setEmbeddedMessage(Message embeddedMessage)
      Sets the embedded message.
      Parameters:
      embeddedMessage - The embedded message.
    • getHeaderEncoding

      public HeaderEncoding getHeaderEncoding()
      Gets the header encoding.
      Returns:
      The header encoding.
    • setHeaderEncoding

      public void setHeaderEncoding(HeaderEncoding headerEncoding)
      Sets the header encoding.
      Parameters:
      headerEncoding - The header encoding.
    • getHeaderCharSet

      public String getHeaderCharSet()
      Gets the header character set.
      Returns:
      The header character set.
    • setHeaderCharSet

      public void setHeaderCharSet(String headerCharSet)
      Sets the header character set.
      Parameters:
      headerCharSet - The header character set.
    • getContentType

      public ContentType getContentType()
      Gets the type of the content.
      Returns:
      The type of the content.
    • setContentType

      public void setContentType(ContentType value)
      Sets the type of the content.
      Parameters:
      value - The type of the content.
    • getContentTransferEncoding

      public ContentTransferEncoding getContentTransferEncoding()
      Gets the content transfer encoding.
      Returns:
      The content transfer encoding.
    • setContentTransferEncoding

      public void setContentTransferEncoding(ContentTransferEncoding value)
      Sets the content transfer encoding.
      Parameters:
      value - The content transfer encoding.
    • getContentDisposition

      public ContentDisposition getContentDisposition()
      Gets the content disposition.
      Returns:
      The content disposition.
    • setContentDisposition

      public void setContentDisposition(ContentDisposition value)
      Sets the content disposition.
      Parameters:
      value - The content disposition.
    • getContentDescription

      public String getContentDescription()
      Gets the content description.
      Returns:
      The content description.
    • setContentDescription

      public void setContentDescription(String value)
      Sets the content description.
      Parameters:
      value - The content description.
    • getContentID

      public String getContentID()
      Gets the content identifier.
      Returns:
      The content identifier.
    • setContentID

      public void setContentID(String value)
      Sets the content identifier.
      Parameters:
      value - The content identifier.
    • getContentLocation

      public String getContentLocation()
      Gets the content location.
      Returns:
      The content location.
    • setContentLocation

      public void setContentLocation(String value)
      Sets the content location.
      Parameters:
      value - The content location.
    • getSubject

      public String getSubject()
      Gets the subject.
      Returns:
      The subject.
    • setSubject

      public void setSubject(String value)
      Sets the subject.
      Parameters:
      value - The subject.
    • getMimeVersion

      public String getMimeVersion()
      Gets the MIME version.
      Returns:
      The MIME version.
    • setMimeVersion

      public void setMimeVersion(String value)
      Sets the MIME version.
      Parameters:
      value - The MIME version.
    • getComments

      public String getComments()
      Gets the comments.
      Returns:
      The comments.
    • setComments

      public void setComments(String value)
      Sets the comments.
      Parameters:
      value - The comments.
    • getKeywords

      public String getKeywords()
      Gets the keywords.
      Returns:
      The keywords.
    • setKeywords

      public void setKeywords(String value)
      Sets the keywords.
      Parameters:
      value - The keywords.
    • getMessageID

      public String getMessageID()
      Gets the message identifier.
      Returns:
      The message identifier.
    • setMessageID

      public void setMessageID(String value)
      Sets the message identifier.
      Parameters:
      value - The message identifier.
    • getResentMessageID

      public String getResentMessageID()
      Gets the resent message identifier.
      Returns:
      The resent message identifier.
    • setResentMessageID

      public void setResentMessageID(String value)
      Sets the resent message identifier.
      Parameters:
      value - The resent message identifier.
    • getDate

      public Date getDate()
      Gets the date.
      Returns:
      The date, or null if not present.
    • setDate

      public void setDate(Date value)
      Sets the date.
      Parameters:
      value - The date.
    • getResentDate

      public Date getResentDate()
      Gets the resent date.
      Returns:
      The resent date, or null if not present.
    • setResentDate

      public void setResentDate(Date value)
      Sets the resent date.
      Parameters:
      value - The resent date.
    • getReferences

      public String getReferences()
      Gets the references.
      Returns:
      The references.
    • setReferences

      public void setReferences(String value)
      Sets the references.
      Parameters:
      value - The references.
    • getTo

      public List<Mailbox> getTo()
      Gets to.
      Returns:
      To.
    • getCc

      public List<Mailbox> getCc()
      Gets the cc.
      Returns:
      The cc.
    • getBcc

      public List<Mailbox> getBcc()
      Gets the bcc.
      Returns:
      The bcc.
    • getReplyTo

      public List<Mailbox> getReplyTo()
      Gets the reply to.
      Returns:
      The reply to.
    • getFrom

      public Mailbox getFrom()
      Gets from.
      Returns:
      From.
    • setFrom

      public void setFrom(Mailbox value)
      Sets from.
      Parameters:
      value - From.
    • getFromAddresses

      public List<Mailbox> getFromAddresses()
      Gets the full list of From mailboxes (RFC 5322 allows more than one).
      Returns:
      The From mailboxes.
    • getSender

      public Mailbox getSender()
      Gets the sender.
      Returns:
      The sender.
    • setSender

      public void setSender(Mailbox value)
      Sets the sender.
      Parameters:
      value - The sender.
    • getResentFrom

      public Mailbox getResentFrom()
      Gets the first Resent-From mailbox. Resent-From is a mailbox-list (RFC 5322 section 3.6.6); use getResentFromAddresses() for the full list.
      Returns:
      The first resent from mailbox.
    • setResentFrom

      public void setResentFrom(Mailbox value)
      Sets the first Resent-From mailbox.
      Parameters:
      value - The first resent from mailbox.
    • getResentFromAddresses

      public List<Mailbox> getResentFromAddresses()
      Gets the full list of Resent-From mailboxes (RFC 5322 allows more than one).
      Returns:
      The Resent-From mailboxes.
    • getResentTo

      public List<Mailbox> getResentTo()
      Gets the Resent-To mailboxes.
      Returns:
      The Resent-To mailboxes.
    • getResentCc

      public List<Mailbox> getResentCc()
      Gets the Resent-Cc mailboxes.
      Returns:
      The Resent-Cc mailboxes.
    • getResentBcc

      public List<Mailbox> getResentBcc()
      Gets the Resent-Bcc mailboxes.
      Returns:
      The Resent-Bcc mailboxes.
    • getResentSender

      public Mailbox getResentSender()
      Gets the resent sender.
      Returns:
      The resent sender.
    • setResentSender

      public void setResentSender(Mailbox value)
      Sets the resent sender.
      Parameters:
      value - The resent sender.
    • getInReplyTo

      public String getInReplyTo()
      Gets the In-Reply-To field: one or more message identifiers (RFC 5322 section 3.6.4), e.g. "<id1@host> <id2@host>".
      Returns:
      The In-Reply-To message identifiers.
    • setInReplyTo

      public void setInReplyTo(String value)
      Sets the In-Reply-To field.
      Parameters:
      value - The In-Reply-To message identifiers.
    • getReturnPath

      public Mailbox getReturnPath()
      Gets the return path.
      Returns:
      The return path.
    • setReturnPath

      public void setReturnPath(Mailbox value)
      Sets the return path.
      Parameters:
      value - The return path.