Deleting a single email message |
Upon establishing a connection to the POP3 server you can mark an individual message for deletion from the mailbox by invoking the Pop#deleteMessage method with an argument of the message id to delete. Message id are 1 based with the first message in mailbox being 1, the second 2 etc.
Example
// establish connection pop.connect();
// mark first message in mailbox for deletion pop.deleteMessage(1);
// delete any messages marked for deletion and disconnect pop.disconnect(); |