Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unseen messages #195

Open
sirishayyagari opened this issue May 22, 2017 · 1 comment
Open

Unseen messages #195

sirishayyagari opened this issue May 22, 2017 · 1 comment

Comments

@sirishayyagari
Copy link

I have this code that is not working, when looping through unseen messages, i am getting an error Message construct issue

RuntimeException: Error fetching overview in Message->getOverview() (line 249 of Message.inc)

below is my code

$server = new Server('imap.gmail.com', 993);
        $server->setAuthentication(#, $#);
        if (!$server) {
            error_log("Cant Connect to mail box " . $comm_email);
            return;
        }
        /** @var Message[] $message */
        $messages = $server->search('UNSEEN');
        $email_data = array();
         $timenow = time();
   
        foreach ($messages as $message) {
             
                $message1 = new Message($message, $server);
                $email_data[$key]['subject'] = $message1->getSubject();
            $email_data[$key]['body'] = $message1->getMessageBody();
            $email_data[$key]['date'] = $message1->getDate();
            $email_data[$key]['reply_toaddress'] = $comm_email;
}


@snezhkodatalead
Copy link

Same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants