Search code examples
phpjqueryajaxemailimap

Fetching new emails by Imap and Ajax


I am developing a program to fetch Emails from my gmail account and show them in my browser. With first load of the page everything is working exactly as I want with jquery Accordion but the problem is when I want to fetch new emails coming to my mailbox with ajax.

Is there any IMAP function to fetch only new emails and not the old ones ? if yes, how can i write it with Ajax in the right place in my page.

Thanks in Advance


Solution

  • As @moonwave99 suggested, there is a unique ID for every message and using that I could retrieve every new message came to my Inbox.