iblazevic
iblazevic

Reputation: 2733

Gmail new email notification

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!

Upvotes: 1

Views: 2591

Answers (2)

PNC
PNC

Reputation: 1962

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

Upvotes: 2

Rick Sanders
Rick Sanders

Reputation: 543

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

Upvotes: 0

Related Questions