This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Saving emails without attachments  RSS feed

 
Ketan KC Chachad
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

We are writing a Java class that reads emails from a mail box and saves the attachments to email on the physical drive. Along with saving the attachments, we need to save the email to the physical drive too but without the attachments. We are to use POP3 for retrieving the emails. We tried calling the removeBodyPart() method of the Multipart class. Although the method returns a true value when passed the index of the part to be removed or even if reference of the part is passed, when we save the Message object, it still has the attachments in it.

We tried calling the setContent() method of the Message class and passed it the Multipart object on which the removeBodyPart() method has been called. But that gives "javax.mail.IllegalWriteException: POP3 messages are read-only" message. Can anyone let me know what can be done for this?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!