Class Email

    • Field Detail

      • m_Subject

        protected String m_Subject
        the subject.
      • m_Body

        protected String m_Body
        the body.
      • m_Attachments

        protected File[] m_Attachments
        the attachments.
      • m_InMemoryAttachments

        protected Map<String,​byte[]> m_InMemoryAttachments
        the in-memory attachments (filename -> byte array).
    • Constructor Detail

      • Email

        public Email()
        Default constructor.
    • Method Detail

      • from

        public Email from​(String from)
        Sets the FROM email address.
        Parameters:
        from - the FROM address
        Returns:
        itself
      • from

        public Email from​(EmailAddress from)
        Sets the FROM email address.
        Parameters:
        from - the FROM address
        Returns:
        itself
      • to

        public Email to​(String to)
        Sets the TO email address.
        Parameters:
        to - the address, can be null
        Returns:
        itself
      • to

        public Email to​(EmailAddress to)
        Sets the TO email address.
        Parameters:
        to - the address, can be null
        Returns:
        itself
      • to

        public Email to​(EmailAddress[] to)
        Sets the TO email addresses.
        Parameters:
        to - the addresses, can be null
        Returns:
        itself
      • cc

        public Email cc​(EmailAddress cc)
        Sets the CC email address.
        Parameters:
        cc - the address, can be null
        Returns:
        itself
      • cc

        public Email cc​(EmailAddress[] cc)
        Sets the CC email addresses.
        Parameters:
        cc - the addresses, can be null
        Returns:
        itself
      • bcc

        public Email bcc​(EmailAddress bcc)
        Sets the BCC email address.
        Parameters:
        bcc - the address, can be null
        Returns:
        itself
      • bcc

        public Email bcc​(EmailAddress[] bcc)
        Sets the BCC email addresses.
        Parameters:
        bcc - the BCC addresses, can be null
        Returns:
        itself
      • getFrom

        public EmailAddress getFrom()
        Returns the sender.
        Returns:
        the sender
      • subject

        public Email subject​(String subject)
        Sets the subject.
        Parameters:
        subject - the subject to use
        Returns:
        itself
      • body

        public Email body​(String body)
        Sets the body.
        Parameters:
        body - the body to use
        Returns:
        itself
      • attachments

        public Email attachments​(File[] attachments)
        Sets the attachments.
        Parameters:
        attachments - the attachments, can be null
        Returns:
        itself
      • inMemoryAttachments

        public Email inMemoryAttachments​(Map<String,​byte[]> attachments)
        Sets the in-memory attachments.
        Parameters:
        attachments - the attachments, can be null
        Returns:
        itself
      • getTo

        public EmailAddress[] getTo()
        Returns the TO recipients.
        Returns:
        the recipients
      • getCC

        public EmailAddress[] getCC()
        Returns the CC recipients.
        Returns:
        the recipients
      • getBCC

        public EmailAddress[] getBCC()
        Returns the BCC recipients.
        Returns:
        the recipients
      • getAttachments

        public File[] getAttachments()
        Returns the attachments.
        Returns:
        the attachments
      • getInMemoryAttachments

        public Map<String,​byte[]> getInMemoryAttachments()
        Returns the in-memory attachments.
        Returns:
        the attachments
      • getSubject

        public String getSubject()
        Returns the subject.
        Returns:
        the subject
      • getBody

        public String getBody()
        Returns the body.
        Returns:
        the body
      • toString

        public String toString()
        Simple info string for debugging purposes.
        Overrides:
        toString in class Object
        Returns:
        the generated string
      • toPlainText

        public String toPlainText()
        Turns the email into a plain text string.
        Returns:
        the generated string