如何从 POP 服务器删除邮件

How to delete mail from POP server

嗨男孩女孩们(当然)

我想通过邮件 ID 从 pop 服务器删除一些邮件,但它不起作用

我做错了什么?

MessageIDTerm[] toDelete = maildb.getMarkAsErased()
//just constructs an array from stored string by me;
if (toDelete.length>0){
    inbox.open(Folder.READ_WRITE);
    Message[] mm = inbox.search(new OrTerm(toDelete));
    for (Message m :mm) {
        m.setFlag(Flags.Flag.DELETED, true);
        maildb.deleteMail(Utils.getMessageID(m));
    }
    //inbox.delete(true); I should NOT delete de inbox folder :D LOL
    inbox.close(true);
}

编辑:

java 邮件 1.4

android 构建工具 23.0.3

编译androidsdk 23

终于有办法了

我会强制转换为 POPMessage,然后删除

((POPMessage)m).setFlag(Flags.Flag.DELETED, true);