?
Solved

JavaMail delete message on server

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

801 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