?
Solved

JavaMail delete message on server

Posted on 2001-08-22
3
Medium Priority
?
1,723 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
  • 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

750 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