php-imap icon indicating copy to clipboard operation
php-imap copied to clipboard

idle does not return data when new mail arrives

Open nguyenthang327 opened this issue 2 months ago • 0 comments

my command

<?php

namespace App\Console\Commands;

use Webklex\IMAP\Commands\ImapIdleCommand;
use Webklex\PHPIMAP\Message;

class CustomImapIdleCommand extends ImapIdleCommand
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'custom_command';

       /**
     * Holds the account information
     *
     * @var string|array $account
     */
    protected $account = "default";

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Callback used for the idle command and triggered for every new received message
     * @param Message $message
     */
    public function onNewMessage(Message $message){
        $this->info("New message received: ".$message->subject);
    }
}

libary: "webklex/laravel-imap": "^6.2"

I can't receive new messages when new emails arrive response error is always "empty response" in nextLine function in ImapProtocol.php file Please help me, thanks

nguyenthang327 avatar Sep 22 '25 03:09 nguyenthang327