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