[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

JavaMail delete message on server

Posted on 2001-08-22
3
Medium Priority
?
1,717 Views
Last Modified: 2013-11-24
HI

I am trying to delete a message, first by setting the

messages[i].setFlag(Flags.Flag.DELETED, true);


then use folder.expunge();


But my pop3 server doe snot support this method.


Is there a method to delete a message on a mail server after reading it,  using JavaMail API??
0
Comment
Question by:TLTEO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Expert Comment

by:ia_ia_ia_1
ID: 6416874
I think u should close the folder using folder.close(true) - the flag indicating u would like to reflect the deletion on the server
0
 
LVL 2

Accepted Solution

by:
ia_ia_ia_1 earned 80 total points
ID: 6416884
This is what could be read in a Sun's tutorial:
"There is an expunge() method of Folder that can be used to delete the messages. However, it doesn't work for Sun's POP3 provider. Other providers may or may not implement the capabilities. It will more than likely be implemented for IMAP providers. Because POP only supports single access to the mailbox, you have to close the folder to delete the messages with Sun's provider"

http://developer.java.sun.com/developer/onlineTraining/JavaMail/contents.html#JavaMailDeleting
0
 

Author Comment

by:TLTEO
ID: 6418434
tks  so simple and so good. apprec it. cheers
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question