0

I know there are many search criteria for imap. What I am doing is automating my support mail and updating the content to my DB. I know there are options to search mail like SINCE after "this day". But I don't want use this because when the mail will crossing a limit, may be inefficient like if I am setting the cron for 30 minutes, It may fetch the same item again and again whole day. this is how I am looking in the inbox imap_search($this->folder, 'FROM "iam@example.com"' );

I saw there is a question regarding this in the link Stackoverflow link

But didn't get an idea actually

I am planing to get all mails greater than an UID and update the latest UID in DB, next time only checking UID greater than this and so on. Please help me how the search code need to modified Thanks in advance

  • 1
    `UID SEARCH UID x:*`. Read about sequence sets in RFC 3501. – Max Jun 05 '18 at 14:36
  • imap_search($this->folder, ' UID SEARCH UID 11:*' ); this code gives me an error code like this Severity: Notice Message: Unknown: Unknown search criterion: UID (errflg=2) – user3649947 Jun 12 '18 at 11:21
  • You have to translate this to your library. That's the raw protocol text. Try something like `imap_search($this_folder, 'UID 11:*', SE_UID)` – Max Jun 12 '18 at 15:01
  • Thanks for the comment @max but that didn't helped me :( very hard to get document regarding this – user3649947 Jun 13 '18 at 08:39
  • How did it not help? Did it give an error? No results? What does your code look like? – Max Jun 13 '18 at 14:33

0 Answers0