Reputation: 1
I am working on a Cron job script that collects Unseen emails from Google imap server to my database. But sometimes, some emails are not read, so they don't get saved into the database. Here is the code:
$connection = imap_open ($imapaddressandbox, $imapuser, $imappassword)
or die("Can't connect to '" . $imapaddress .
"' as user '" . $imapuser .
"' with password '" . $imappassword .
"': " . imap_last_error());
$m_search=imap_search ($connection, 'UNSEEN');
if($m_search === false){
email_log("No New Messages ");
}
It seams like for some reason some emails get skipped although they are unread.
Can anyone have an idea why?
Just a note, email is like [email protected], but using google email.
Thanks
Upvotes: 0
Views: 1764