imap_search();不与雅虎合作

时间:2015-03-12 14:40:06

标签: php imap yahoo

我有一个代码,可以搜索几个电子邮箱,检查发送到该电子邮件帐户的电子邮件是否落在收件箱或垃圾邮件中。这是代码:

// set the time the script can run to infinite.
set_time_limit (0);

// Require the connection file to the inboxes
require('conn.php');

// Temporry array with the clients
require('array.php');


// Begin Gmail Search
$gresult = array();
foreach ($clients as $key => $value) {
    $check = " ";
    $check = imap_search($gconnection1, 'FROM "'. $value . '"', SE_UID);
    if ($check) {
            $gresult["$key"] = 'v';
    } else {
        $check = " ";
        $check = imap_search($gconnection2, 'FROM "'. $value . '"', SE_UID);
        if ($check) {
            $gresult["$key"] = 'x';
        } else {
            $gresult["$key"] = 'nf';
        }
    }   
} // end of foreach loop  for Gmail Search


// Begin Outlook Search
$oresult = array();
foreach ($clients as $key => $value) {
    $check = " ";
    $check = imap_search($oconnection1, 'FROM "'. $value . '"', SE_UID);
    if ($check) {
            $oresult["$key"] = 'v';
    } else {
        $check = " ";
        $check = imap_search($oconnection2, 'FROM "'. $value . '"', SE_UID);
        if ($check) {
            $oresult["$key"] = 'x';
        } else {
            $oresult["$key"] = 'nf';
        }
    }   
} // end of foreach loop  for Outlook Search

// Begin Yahoo search
$yresult = array();
foreach ($clients as $key => $value) {
    $check = " ";
    $check = imap_search($yconnection1, 'FROM "'. $value . '"');
    if ($check) {
            $yresult["$key"] = 'v';
    } else {
        $check = " ";
        $check = imap_search($yconnection2, 'FROM "'. $value . '"', SE_UID);
        if ($check) {
            $yresult["$key"] = 'x';
        } else {
            $yresult["$key"] = 'nf';
        }
    }   
} // end of foreach loop  for Gmail Search

// Debbuging

echo print_r($gresult,1);
echo print_r($oresult,1);
echo print_r($yresult,1);

echo imap_last_error();

该脚本为Gmail和Outlook帐户提供了正确的结果,但在涉及到Yahoo时会出现此错误:

注意:未知:[SERVERBUG] SEARCH服务器错误 - 请稍后在第0行的“未知”中重试(errflg = 2)

我试图寻找答案,却找不到任何答案。

0 个答案:

没有答案