# acymailing/10.10.2/back/Libraries/Imap2/Thread.php

AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress, version 10.10.2. 34 lines.

- Page: https://pluginprobe.com/plugins/acymailing/10.10.2/code/back/Libraries/Imap2/Thread.php
- Raw: https://pluginprobe.com/plugins/acymailing/10.10.2/raw/back/Libraries/Imap2/Thread.php
- Modified: 2025-04-10T12:24:58+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/acymailing/10.10.2/code/back/Libraries/Imap2/Thread.php#L10-L20`.

```php
<?php

/*
 * This file is part of the PHP IMAP2 package.
 *
 * (c) Francesco Bianco <bianco@javanile.org>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace AcyMailing\Libraries\Imap2;

class Thread
{
    public static function thread($imap, $flags = SE_FREE)
    {
        if (is_a($imap, Connection::class)) {
            $client = $imap->getClient();
            #$client->setDebug(true);

            $thread = $client->thread($imap->getMailboxName());

            if (empty($thread->count())) {
                return false;
            }

            return $thread->get();
        }

        return imap_thread($imap, $flags);
    }
}

```
