Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

proble with message[i]. getContent().toString();  RSS feed

 
Himanshu Bisht
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
need help.
I am reading messages from mail box and writing the sender and body to a file.
but in some cases especially where the body is short it just write the following message instead of the main message.

javax.mail.internet.MimeMultipart@576e70

It is hard to understand.
Please guide.
himanshu
 
Nileesha Bojjawar
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Himanshu,
IMO, You must check the message contenttype first to see if it is just plain/text, doing so you can get the toString() to return the mail body, But in some cases looks like your content is a MultiPart content.By checking its type, u an then call get BodyPart on that multi part object and then call getcontent on it.

Hope this helps.

Regards,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!