Php 将IMAP电子邮件标记为已读不工作

Php 将IMAP电子邮件标记为已读不工作,php,imap,Php,Imap,好的,我的问题显然在标题中。 这个代码有什么错 输入: function mark_email_as_read() { if (isset($_SESSION['talent_user_id']) and $_SESSION['talent_user_id'] > 0) { $peek = $this->peek(); $uid = $this->common_model->search_get($this->url, 'uid');

好的,我的问题显然在标题中。 这个代码有什么错

输入:

function mark_email_as_read() {

    if (isset($_SESSION['talent_user_id']) and $_SESSION['talent_user_id'] > 0) {

    $peek = $this->peek();  
    $uid = $this->common_model->search_get($this->url, 'uid');
    $msgno = imap_msgno($this->imap, $uid);
    $user_id = $_SESSION[$this->session_prefix.'_user_id'];
    $acc = $this->common_model->search_get($this->url,'acc');
    $folder = $this->common_model->search_get($this->url,'accfolder');

    $ssl = false;

    $ssl=($ssl==false)?"/novalidate-cert":"";

    $host = $this->email_accounts[$this->the_helpdesk_view][$this->the_helpdesk_company]['server'];
    $port = $this->email_accounts[$this->the_helpdesk_view][$this->the_helpdesk_company]['port'];
    $folder = $this->email_accounts[$this->the_helpdesk_view][$this->the_helpdesk_company]['folder'];
    $user = $this->email_accounts[$this->the_helpdesk_view][$this->the_helpdesk_company]['user'];
    $pass = $this->email_accounts[$this->the_helpdesk_view][$this->the_helpdesk_company]['pass'];

        $this->imap = imap_open("{"."$host:$port/imap$ssl"."}$folder", $user, $pass) or die("can't connect: " . imap_last_error());

        $imap = $this->imap;

        $msgnum = imap_msgno($imap, $msgno);

        if ($peek==true) {
            imap_clearflag_full($imap, $msgnum, '\flagged');
            echo"oh dear";
        } else {
            imap_setflag_full($imap, $msgnum, '\seen');
            echo"set";
        }
        echo "its working i think";
        imap_headers($this->imap);
        echo"well its got here";
    }
}
输出:


嗯,它没有显示任何东西,但是,它不会像看到的那样标记。你能帮忙吗?

你有错误报告功能吗?是的,我有错误报告功能。不,我收到一个“设置,我认为它工作正常,它在这里运行良好”的输出。你能给我们看一下peek()吗?