GMAIL API - Quickest method to check for new Mail

2019-08-23 02:42发布

I'm getting some offers by emails. And there is a competition who get it first. They send an email with a verification code inside.

Which solution is best to check for new gmail messages and get new message body ASAP?

I heard about

  • IMAP IDLE.. is that quick enough?
  • POP3 is it better to check for new messages via POP3 continuously?

3条回答
我欲成王,谁敢阻挡
2楼-- · 2019-08-23 03:10

The fastest method would be IMAP clearly

it allows a client to indicate to the server that it is ready to accept real-time notifications. The basic network use of the IDLE command is very small, and so it makes very efficient use of bandwidth

A good IMAP server will have minimal overhead for an Idle connection, and it support 10’s or 100’s of thousands of connections.

Another practical problem is that current phone networking technology will lose IP network connectivity from time to time, and this will need to be automatically re-established, and the

IMAP connection re-established if this is lost due to a long network failure.

查看更多
欢心
3楼-- · 2019-08-23 03:19

Note, that there is still a large delay between when that email is sent, and in how that email is processed by any number of intermediate servers before it's ultimately in an IMAP/POP account ready for access by the client.

Are you sure you're optimising the correct problem?

查看更多
Animai°情兽
4楼-- · 2019-08-23 03:31

If you authentication is open, maybe a simple Web request is fastest of all.

查看更多
登录 后发表回答