对邮件的删除就是这样的,它是一个两阶段过程。你不就是想每次收信都收新信嘛,
这样不就可以实现吗?取的时候将邮件删除!用folder.expunge()不爽吗?
>>你用的是什么provider,是自己开发的吗?
就是Sunr的东东。
>>可以讲讲如何写provider???
这可要花点功夫。看看下面的东东。
The JavaMail API is composed of a set of abstract classes that model the various
pieces of a typical mail system. These classes include,
#Message—Abstract class that represents an electronic mail message.
JavaMail implements the RFC822 and MIME Internet messaging standards. The
MimeMessage class extends Message to represent a MIME-style email message.
#Store—Abstract class that represents a database of messages maintained by a
mail server and grouped by owner. A Store uses a particular access protocol.
#Folder—Abstract class that provides a way of hierarchically organizing
messages. Folders can contain messages and other folders. A mail server
provides each user with a default folder, and users can typically create and fill
subfolders.
#Transport—Abstract class that represents a specific transport protocol. A
Transport object uses a particular transport protocol to send a message.
As a service provider, you implement abstract classes in terms of your specific
protocol or system. For example, an IMAP provider implements the JavaMail API
using the IMAP4 protocol. Clients then
use your implementation to manipulate their
electronic mail.
If you have time and interest,just try it !