java - javamail receiving problems -


I have a big problem. I have to explain the meetings sent to a specific mail account. The problem is that I have to attach them alone Can not explain with, but if my code has been forwarded to the accident.

  multipart multipart = (Multipart) message.getContent (); For (int x = 0; x & lt; multipart.getCount (); x ++) {BodyPart BodyPart = Multipurpose. JetbedPart (x); String [] nameHeader = bodyPart.getHeader ("content-displacement"); String nature = bodyPart.getDisposition (); If (bodyPart.isMimeType ("Multipurpose / Option") || bodyPart.isMimeType ("Multilanguage / Blended")) {Multipart multipart2 = (Multipart) bodyPart.getContent (); For (int y = 0; y & lt; multipart2.getCount (); y ++) {bodypart bodypart 2 = multipart 2.getBodyPart (y); If (bodyPart2.isMimeType ("text / calendar")) {partCalendar = bodyPart2; } And if (bodyPart.isMimeType ("text / html") bodyPart.isMimeType ("text / plain")) {body + = bodyPart.getContent (). ToString (); }}} Else if (bodyPart.isMimeType ("text / calendar") {if (nameHeader = Null & amp;! & Amp;; Amp;! NameHeader [0] .isEmpty ()) {partCalendar = bodypart; DataHandler Handler = bodyPart.getDataHandler (); // is forwarded here} and {partCalendar = bodyPart; }} Else if (bodyPart.isMimeType ("text / html") || bodyPart.isMimeType ("text / plain") {body + = bodyPart.getContent () toString (). } And if (disposition.equals (bodypart.ATTACHMENT)) {System.out.println ("he attached"); }}  

This is how I get the information of the calendar

  Blob calendarContent = NonContextualLobCreator.INSTANCE.wrap (NonContextualLobCreator.INSTANCE .createBlob (partCalendar) GetInputStream (), PartCalendar.getSize ()));  

It seems that: - When there is no one in the meeting, then the "mime-type" content / nature is without "text / calendar" and without any file name - when If the meeting is attached to the same mail then type is "multipart / optional", so I have to get body parts of the body.

Both of these are working, but the problem occurs When the meeting is forwarded:

- Meet me to meet mimtetype Forwarding is the name of the "text / calendar" and "content-configuration" file, but I can not remove content like two other people because I can not generate the bob

3 points ( Content type of text / calendar; charset = UTF-8, method = request; name = invite.ics] 1-point content-type (

Sorry for my english, I hope someone May help me.


Comments