Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for a real-time IMAP notification of new Emails

I'm looking for a way to monitor a GMail inbox for new e-mails. However, I want to avoid checking every few minutes and I'm looking for some sort of real-time notification. I've noticed that Outlook (and other IMAP-supporting clients) instantly show when there is a new e-mail, but unfortunately all .NET IMAP libraries seem to lack this functionality.

Does anyone know of an IMAP library that has this functionality? Or is there another way to be instantly notified of new message without doing some short-period polling?

like image 398
Emil Avatar asked Apr 14 '09 15:04

Emil


1 Answers

You need to handle IMAP IDLE.

This will notify you when new messages arrive, without constant polling (which is bad).


A very good, commercial .NET IMAP library is MailBee.Net. I used it for a small project a while back, and it seemed to handle things very well, and be fairly easy to work with. There may be others - just search in your library for sending the IDLE command or IDLE command handling, and you'll likely find something.

like image 109
Reed Copsey Avatar answered Oct 24 '22 04:10

Reed Copsey