問題描述
我正在尋找一種方法來監控新電子郵件的 GMail 收件箱.但是,我想避免每隔幾分鐘檢查一次,我正在尋找某種實時通知.我注意到 Outlook(和其他支持 IMAP 的客戶端)會在有新電子郵件時立即顯示,但不幸的是,所有 .NET IMAP 庫似乎都缺少此功能.
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.
有誰知道有這個功能的 IMAP 庫嗎?或者有沒有另一種方法可以在不進行一些短期輪詢的情況下立即收到新消息的通知?
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?
推薦答案
你需要處理IMAP 空閑.
這會在新消息到達時通知您,無需不斷輪詢(這很糟糕).
This will notify you when new messages arrive, without constant polling (which is bad).
一個非常好的商業 .NET IMAP 庫是 MailBee.Net.不久前我將它用于一個小項目,它似乎處理得很好,并且相當容易使用.可能還有其他 - 只需在您的庫中搜索發送 IDLE 命令或 IDLE 命令處理,您可能會找到一些東西.
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.
這篇關于尋找新電子郵件的實時 IMAP 通知的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!