Gmail new email notification

我们两清 提交于 2020-01-14 03:36:09

问题


I've been doing some research into how to get new email notification from gmail. From what I am reading it doesn't really seem to be possible.

Gmail API has no webhooks or anything that would allow to get new email notification. Also IMAP api doesn't seem to be able to, at least from what I'm reading, documentation is rather vague.

So, I guess I am asking is there a way to achieve receiving notification when new email arrives so we can process it when its received or is polling for new emails since last pol the only option.

I don't care in what language is potential library written that could make this possible.

Thanks in advance for any information!


回答1:


Check out this.

Gmail push notifications are now available and mean you don't need to poll anymore.

https://developers.google.com/gmail/api/guides/push




回答2:


IMAP IDLE will notify you of new messages:

1 LOGIN rfs9999 "XXXX"

* OK Gimap ready for requests from xx.xx.xx.xx u10mb3060044oek

2 IDLE

+ idling

When new messages arrives you'll be notified:

* 7541 EXISTS

* 7542 EXISTS

-Rick



来源:https://stackoverflow.com/questions/29438613/gmail-new-email-notification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!