Supporto per il comando IMAP IDLE
Contents
[
Hide
]
Aspoe.Email API ImapClient fornisce la capacità di aprire una connessione al server e attendere l’arrivo di un messaggio email. Questo consente di evitare di interrogare ripetutamente il server per le email in arrivo. Il seguente frammento di codice mostra come supportare il comando IMAP Idle.
// For complete examples and data files, please go to https://github.com/aspose-email/Aspose.Email-for-Java
// Connect and log in to IMAP
ImapClient client = new ImapClient("imap.domain.com", "username", "password");
client.startMonitoring(new ImapMonitoringEventHandler() {
public void invoke(Object sender, ImapMonitoringEventArgs e) {
System.out.println(e.getNewMessages().length);
System.out.println(e.getDeletedMessages().length);
}
});
client.stopMonitoring("Inbox");