Solved

JavaMail delete message on server

Posted on 2001-08-22
3
1,691 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 20 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Checkbox and ListView in Android Layout 4 66
ForLoop Example 3 49
hibernate jars 4 32
difference between sorce folder and folder in eclipise 3 13
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

809 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