Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/
I am reading email via IMAP.
I am getting follwing output when I call "message.getContent().toString()"
javax.mail.internet.MimeMultipart@451cf8e9
How do I resolve this?
I am using this function and its working like charm
public static String bodyFromMimeType(Object message) throws MessagingException, IOException{ String body = message.toString(); if(message instanceof Multipart){ Multipart multipart = (Multipart) message; for(int x = 0; x < multipart.getCount() ; x++){ BodyPart bodyPart = multipart.getBodyPart(x); String disposition = bodyPart.getDisposition(); if(disposition !=null && disposition.equals(BodyPart.ATTACHMENT)) continue; else{ return bodyPart.getContent().toString(); } } } return body; }
This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!
1.4k questions
1.6k answers
866 comments
1.9k users