Class EmailSrv.EmailContent

  • Enclosing class:
    EmailSrv

    public static class EmailSrv.EmailContent
    extends Object
    manipulate from Message separate attach file to embed, attach, un-know list
    Author:
    hieplq
    • Field Detail

      • fromAddress

        public List<String> fromAddress
        contain list from address. when @see javax.mail.Message#getFrom() return null, this list is empty
      • messageID

        public String messageID
        unique value. has max length is 998 charater http://tools.ietf.org/html/rfc4130#section-5.3.3
      • subject

        public String subject
      • sentDate

        public Date sentDate
      • lsAttachPart

        public List<javax.mail.BodyPart> lsAttachPart
        list attach file
      • lsEmbedPart

        public List<javax.mail.BodyPart> lsEmbedPart
        list embed file
      • lsUnknowPart

        public List<javax.mail.Part> lsUnknowPart
        list part unknow to process
    • Constructor Detail

      • EmailContent

        public EmailContent()
    • Method Detail

      • getHtmlContent

        public String getHtmlContent​(boolean withEmbedImg)
                              throws javax.mail.MessagingException,
                                     IOException
        get html content, when withEmbedImg = true, read embed image to base64 and embed to html content
        Parameters:
        withEmbedImg -
        Returns:
        return null when has empty content
        Throws:
        Exception
        javax.mail.MessagingException
        IOException
      • getHTMLImageBodyParts

        public ArrayList<javax.mail.BodyPart> getHTMLImageBodyParts()
                                                             throws javax.mail.MessagingException,
                                                                    IOException
        Throws:
        javax.mail.MessagingException
        IOException
      • getTextContent

        public String getTextContent()
        get text content
        Returns:
        return null when has no content