1
0
-1

Problem:

I am using email pool to read the email the data I am receiving is in multipart or in text format the code which I am using is here.

 if (message.getContent() instanceof Multipart) {
                    Multipart multipart = (Multipart)message.getContent();
                    for (int j = 0; j < multipart.getCount(); j++) {
                        BodyPart bodyPart = multipart.getBodyPart(j);
                        String disposition = bodyPart.getDisposition();
                        if (disposition != null && (disposition.equalsIgnoreCase("ATTACHMENT"))) { // BodyPart.ATTACHMENT doesn't work for gmail
                            debug("Attachment found");
                        } else {
                            content= bodyPart.getContent().toString();
                            break;
                        }
                    }
                } else {
                    content = message.getContent().toString();
                }

Outpout:

1.Simple Text

2. Mime Multipart



Requirement:

Read the email body in html format so it will be good to read

so please suggest me how can I read the body content in html format istead of text or multipart


    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1
      1. mohd salman

        Mime type is Multipart I want exact html format as it is sent to me

      CommentAdd your comment...