当前位置: 首页>>代码示例>>PHP>>正文


PHP imap_list函数代码示例

本文整理汇总了PHP中imap_list函数的典型用法代码示例。如果您正苦于以下问题:PHP imap_list函数的具体用法?PHP imap_list怎么用?PHP imap_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了imap_list函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: free

 public function free($util)
 {
     $stream = imap_open("{imap.club-internet.fr:993/imap/SSL}", $util, "wrasuxwr");
     var_dump($stream);
     $check = imap_check($stream);
     $list = imap_list($stream, "{imap.club-internet.fr}", "*");
     imap_createmailbox($stream, '{imap.club-internet.fr}brubru');
     $getmailboxes = imap_getmailboxes($stream, "{imap.club-internet.fr}", "*");
     $headers = imap_headers($stream);
     $num_msg = imap_num_msg($stream);
     $status = imap_status($stream, "{imap.club-internet.fr:993/imap/SSL}INBOX", SA_ALL);
     $messages = imap_fetch_overview($stream, "1:" . $num_msg);
     $structure = imap_fetchstructure($stream, 2);
     $body = utf8_encode(quoted_printable_decode(imap_body($stream, '2')));
     // imap_delete($stream, '1');
     // imap_expunge($stream);
     return view('Imap.Imap')->with(compact('resource'))->with(compact('check'))->with(compact('list'))->with(compact('getmailboxes'))->with(compact('headers'))->with(compact('num_msg'))->with(compact('status'))->with(compact('errors'))->with(compact('messages'))->with(compact('structure'))->with(compact('body'));
 }
开发者ID:gAb09,项目名称:NetP,代码行数:18,代码来源:ImapController.php

示例2: init

 function init()
 {
     if (isset($_SESSION[IMAP_SESSION]['cache'])) {
         $this->_sessionCache =& $_SESSION[IMAP_SESSION]['cache'];
     } else {
         $this->_sessionCache =& $_SESSION[IMAP_SESSION]['cache'];
         //формируем список ящиков
         $imap_manager =& IMAPManager::singleton();
         $serverString = '{' . $imap_manager->server . '}';
         $bIsGmail = strpos($serverString, 'gmail') !== FALSE;
         $aSkipUnseenMailboxes = $bIsGmail ? array('Вся почта', 'Корзина', 'Отправленные', 'Помеченные', 'Черновики') : array();
         $offset = strlen($serverString);
         $mboxes = @imap_list($imap_manager->stream(), $serverString, '*');
         if (is_array($mboxes)) {
             foreach ($mboxes as $box) {
                 $box = substr($box, $offset);
                 //remove server string
                 $status = @imap_status($imap_manager->stream(), $serverString . $box, SA_ALL);
                 $this->_sessionCache[$box] = array();
                 $this->_sessionCache[$box]['k'] = implode('|', array($status->messages, $status->uidnext, $status->uidvalidity));
                 $this->_sessionCache[$box]['name'] = $box == 'INBOX' ? 'Входящие' : $imap_manager->decodeMailboxName($bIsGmail ? str_replace('[Gmail]/', '', $box) : $box);
                 $this->_sessionCache[$box]['unseen'] = $bIsGmail && in_array($this->_sessionCache[$box]['name'], $aSkipUnseenMailboxes) ? -1 : $status->unseen;
                 $this->_sessionCache[$box]['d'] = array();
                 $this->_saveCache($box);
             }
         }
     }
 }
开发者ID:Sywooch,项目名称:dobox,代码行数:28,代码来源:class.imap.cache.php

示例3: get_mailboxes

 /**
  * @param $ref
  * @param string $pattern
  * @return IMAP\Mailbox[]
  */
 function get_mailboxes($ref, $pattern = '*')
 {
     $ret = array();
     foreach (imap_list($this->con, $ref, $pattern) as $mb) {
         $ret[] = $this->get_mailbox($mb);
     }
     return $ret;
 }
开发者ID:splitice,项目名称:radical-mail,代码行数:13,代码来源:IMAP.php

示例4: imapList

 /**
  * liefert eine Liste der verfügbaren Folder
  * @param string $pattern
  * @return array
  */
 public function imapList($pattern = '*')
 {
     if ($this->imap === null) {
         throw new IMAPException(__METHOD__ . ' not connected');
     }
     $this->imapPing(true);
     return imap_list($this->imap, $this->server, $pattern);
 }
开发者ID:NEOatNHNG,项目名称:cacert-testmgr,代码行数:13,代码来源:imapConnection.php

示例5: listMailboxes

 function listMailboxes()
 {
     $mailboxes = imap_list($this->stream, $this->target, "*");
     foreach ($mailboxes as &$folder) {
         $folder = str_replace($this->target, "", imap_utf7_decode($folder));
     }
     return $mailboxes;
 }
开发者ID:kam1katze,项目名称:ocDashboard,代码行数:8,代码来源:imap.php

示例6: getMailboxes

 /**
  * Get all available mailboxes from the server
  *
  * @return array|string returns a array with all messagebox names
  */
 public function getMailboxes()
 {
     $boxes = array();
     $list = imap_list($this->con, $this->res, '*');
     foreach ($list as $item) {
         $boxes[] = new Mailbox($this, $item);
     }
     return $boxes;
 }
开发者ID:hadvig,项目名称:laravel-imap,代码行数:14,代码来源:Client.php

示例7: getListingFolders

 public function getListingFolders()
 {
     $folders = imap_list($this->Stream, $this->_connectionString, "*");
     foreach ($folders as $key => $folder) {
         $folder = str_replace($this->_connectionString, "", imap_utf7_decode($folder));
         $folders[$key] = $folder;
     }
     return $folders;
 }
开发者ID:ch0c4,项目名称:cake-mailer,代码行数:9,代码来源:Connection.php

示例8: getMailboxes

 /**
  * Gets all mailboxes
  *
  * @return array of string
  * @throws DriverException
  */
 public function getMailboxes()
 {
     $mailboxes = array();
     $foo = imap_list($this->resource, $this->server, '*');
     if (!$foo) {
         throw new DriverException("Cannot get mailboxes from server: " . imap_last_error());
     }
     foreach ($foo as $mailbox) {
         $mailboxes[] = mb_convert_encoding(str_replace($this->server, '', $mailbox), 'UTF8', 'UTF7-IMAP');
     }
     return $mailboxes;
 }
开发者ID:jkuchar,项目名称:MailLibrary,代码行数:18,代码来源:ImapDriver.php

示例9: getFoldersList

 public function getFoldersList()
 {
     $out = [];
     $list = imap_list($this->imapStream, $this->getMailbox(), '*');
     if (is_array($list)) {
         foreach ($list as $val) {
             $out[] = imap_utf7_decode($val);
         }
     } else {
         throw new \Exception('Imap list failed: ' . imap_last_error());
     }
     return $out;
 }
开发者ID:trejjam,项目名称:emailing,代码行数:13,代码来源:Imap.php

示例10: boxes

function boxes()
{
    global $mail, $user, $pass;
    //
    $mbox = imap_open($mail, $user, $pass);
    if (!$mbox) {
        die("boxes: mailbox open FAILED.");
    }
    //
    $boxes = imap_list($mbox, $mail, "*");
    //
    imap_close($mbox);
    return $boxes;
}
开发者ID:rwadkins,项目名称:EnyoJS-NYC-Subway-Status,代码行数:14,代码来源:boxesInfo0.php

示例11: mail_box

function mail_box()
{
    $IMAP_READTIMEOUT = 1;
    //    imap_timeout(1, $IMAP_READTIMEOUT) ;
    $mbox = imap_open("{pop.163.com:110/pop3/notls}", "wanghuafengc", "081013303");
    $folders = imap_list($mbox, "{pop.163.com:110/pop3/}", "%");
    if ($folders == false) {
        echo "Call failed<br />\n";
    } else {
        foreach ($folders as $val) {
            echo $val . "<br />\n";
        }
    }
}
开发者ID:sdgdsffdsfff,项目名称:qq_mail_login,代码行数:14,代码来源:pop_imap.php

示例12: showEmails

 public function showEmails()
 {
     $connect_to = '{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX';
     $user = 'a.majik7@gmail.com';
     $password = '77andy77';
     $inbox = imap_open($connect_to, $user, $password) or die("Can't connect to '{$connect_to}': " . imap_last_error());
     $folders = imap_list($inbox, "{imap.gmail.com:993/imap/ssl}", "*");
     //return dd($folders);
     //return $message_count = imap_num_msg($inbox);
     $emails = imap_search($inbox, 'SINCE ' . date('d-M-Y', strtotime("-2 week")));
     $output = [];
     $emailCount = imap_num_msg($inbox);
     rsort($emails);
     $i = 0;
     foreach ($emails as $mail) {
         $headerInfo = imap_headerinfo($inbox, $mail);
         //return var_dump(dd($headerInfo));
         $message = "";
         $output[$i]['subject'] = isset($headerInfo->Subject) ? imap_utf8($headerInfo->Subject) : "0";
         $output[$i]['from'] = imap_utf8($headerInfo->from[0]->personal);
         $output[$i]['toaddress'] = $headerInfo->toaddress;
         $output[$i]['to'] = array_shift($headerInfo->to);
         $output[$i]['date'] = $headerInfo->date[0];
         $output[$i]['fromaddress'] = $headerInfo->fromaddress[0];
         $output[$i]['reply_toaddress'] = $headerInfo->reply_toaddress[0];
         $output[$i]['date'] = date('d-m-Y ' . '[' . 'H:i' . ']', strtotime($headerInfo->date) + 3600);
         $output[$i]['unseen'] = $headerInfo->Unseen;
         $output[$i]['flagged'] = $headerInfo->Flagged;
         $message = imap_fetchbody($inbox, $mail, 2);
         if (base64_decode($message, true)) {
             //message body if base64 encoded
             $message = base64_decode($message);
         } else {
             //message body is not base64 encoded
             $message = imap_fetchbody($inbox, $mail, 1);
         }
         $output[$i]['body'] = $message;
         $i++;
     }
     return dd($output);
     //return view('aßdministration.email.showEmails')->with('output', $output);
 }
开发者ID:andy-am,项目名称:itam,代码行数:42,代码来源:EmailController.php

示例13: getLabels

 function getLabels()
 {
     $this->load->database();
     $this->load->model('grabber');
     $inbox = $this->getConnect('INBOX');
     $folders = imap_list($inbox, "{imap.gmail.com:993/imap/ssl}", "*");
     $i = 0;
     $folde = array();
     foreach ($folders as $folder) {
         $fold = str_replace("{imap.gmail.com:993/imap/ssl}", " ", imap_utf7_decode($folder));
         if ($this->grabber->check_label_exist(htmlentities($fold)) == 0) {
             $folde[$i]['id'] = uniqid();
             $folde[$i]['name'] = htmlentities($fold);
             $i++;
         }
     }
     if (count($folde) > 0) {
         $this->grabber->insert_labels($folde);
     }
     //imap_close($inbox);
 }
开发者ID:shibubhat,项目名称:shiburepo,代码行数:21,代码来源:welcome.php

示例14: imap_get_url

function imap_get_url($u)
{
    if (!($c = imap_open_url($u))) {
        return FALSE;
    }
    extract(parse_url($u));
    extract(imap_parse_path($path));
    if ($mailbox) {
        if ($uid) {
            $msgno = imap_msgno($c, $uid);
            $o = imap_fetchstructure($c, $msgno);
        } else {
            $o = array();
            $n = imap_num_msg($c);
            while ($i++ < $n) {
                $o[] = imap_fetchheader($c, $i);
            }
        }
    } else {
        $o = imap_list($c, '{}', '*');
    }
    return $o;
}
开发者ID:nbtscommunity,项目名称:phpfnlib,代码行数:23,代码来源:imap.php

示例15: open_mailbox

 function open_mailbox($folder = "", $ops = OP_HALFOPEN, $fatal = true)
 {
     if ($this->connection && is_resource($this->connection)) {
         imap_close($this->connection);
     }
     $this->connect_string = '{' . $this->host . ':' . $this->port . '/' . $this->protocol . config::get_config_item("allocEmailExtra") . '}';
     $this->connection = imap_open($this->connect_string, $this->username, $this->password, $ops);
     if (!$this->connection && $fatal) {
         alloc_error("Unable to access mail folder(1).");
     }
     $list = imap_list($this->connection, $this->connect_string, "*");
     if (!is_array($list) || !count($list)) {
         // || !in_array($connect_string.$folder,$list)) {
         $this->unlock();
         imap_close($this->connection);
         if ($fatal) {
             alloc_error("Unable to access mail folder(2).");
         }
     } else {
         $rtn = imap_reopen($this->connection, $this->connect_string . $folder);
         $errs = print_r(imap_errors(), 1);
         if (!$rtn || preg_match("/Invalid mailbox name/i", $errs) || preg_match("/Mailbox does not exist/i", $errs)) {
             $rtn = imap_reopen($this->connection, $this->connect_string . str_replace("/", ".", $folder));
         }
         if (!$rtn) {
             imap_close($this->connection);
             if ($fatal) {
                 alloc_error("Unable to access mail folder(3).");
             }
         }
     }
     if (!$rtn && $fatal) {
         alloc_error("<pre>IMAP errors: " . print_r(imap_errors(), 1) . print_r(imap_alerts(), 1) . "</pre>");
     }
     return $rtn;
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:36,代码来源:email_receive.inc.php


注:本文中的imap_list函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。