• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP imap_close函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Logoff

 function Logoff()
 {
     if ($this->_mbox) {
         imap_close($this->_mbox);
         debugLog("IMAP connection closed");
     }
 }
开发者ID:BackupTheBerlios,项目名称:z-push-svn,代码行数:7,代码来源:imap.php


示例2: closeImap

 protected function closeImap($inbox = null)
 {
     if (!$inbox) {
         $inbox = $this->inbox;
     }
     imap_close($inbox);
 }
开发者ID:ephp,项目名称:imap,代码行数:7,代码来源:ImapController.php


示例3: authUser

 /**
  * Authenticates user
  * @param string $username
  * @param string $password
  * @return boolean
  */
 function authUser($username, $password)
 {
     // Returns true if the username and password work
     // and false if they are wrong or don't exist.
     $this->imapUsername = $username;
     foreach ($this->imapHosts as $host) {
         // Try each host in turn
         $host = trim($host);
         switch ($this->imapType) {
             case "imapssl":
                 $host = '{' . $host . "/imap/ssl}INBOX";
                 break;
             case "imapcert":
                 $host = '{' . $host . "/imap/ssl/novalidate-cert}INBOX";
                 break;
             case "imaptls":
                 $host = '{' . $host . "/imap/notls}INBOX";
                 break;
             default:
                 $host = '{' . $host . '}INBOX';
         }
         //error_reporting(0);
         $connection = imap_open($host, $username, $password, OP_HALFOPEN);
         if ($connection) {
             imap_close($connection);
             return true;
         }
     }
     $this->err_msg = translate('IMAP Authentication: no match');
     return false;
     // No match
 }
开发者ID:brucewu16899,项目名称:mailzu,代码行数:38,代码来源:IMAPAuth.class.php


示例4: GetIMAPContent

 /**
  * Gets IMAP content
  *
  * @param string $imapHost
  * @param string $imapUser
  * @param string $imapPassword
  * @param \Swiftriver\Core\ObjectModel\Channel $channel
  *
  * @return $contentItems[]
  */
 private function GetIMAPContent($imapHost, $imapUser, $imapPassword, $channel)
 {
     $imapResource = imap_open("{" . $imapHost . "}INBOX", $imapUser, $imapPassword);
     //Open up unseen messages
     $imapEmails = imap_search($imapResource, strtoupper($channel->subType));
     $contentItems = array();
     if ($imapEmails) {
         //Put newest emails on top
         rsort($imapEmails);
         foreach ($imapEmails as $Email) {
             //Loop through each email and return the content
             $email_overview = imap_fetch_overview($imapResource, $Email, 0);
             $email_message = imap_fetchbody($imapResource, $Email, 2);
             $source_name = $imapUser;
             $source = \Swiftriver\Core\ObjectModel\ObjectFactories\SourceFactory::CreateSourceFromIdentifier($source_name);
             $source->name = $source_name;
             $source->parent = $channel->id;
             $source->type = $channel->type;
             $source->subType = $channel->subType;
             $item = \Swiftriver\Core\ObjectModel\ObjectFactories\ContentFactory::CreateContent($source);
             $item->text[] = new \Swiftriver\Core\ObjectModel\LanguageSpecificText(null, $email_overview[0]->subject, array($email_message));
             //the message
             $item->link = null;
             $item->date = $email_overview[0]->date;
             $contentItems[] = $item;
         }
         imap_close($imapResource);
         return $contentItems;
     }
     imap_close($imapResource);
     return null;
 }
开发者ID:Bridgeborn,项目名称:Swiftriver,代码行数:42,代码来源:IMAPParser.php


示例5: emailDeliverFailBySubject

 public static function emailDeliverFailBySubject($subject)
 {
     $mailcnf = "outlook.office365.com:993/imap/ssl/novalidate-cert";
     $username = MAILACCOUNT;
     $pw = MAILPASSWORD;
     $conn_str = "{" . $mailcnf . "}INBOX";
     $inbox = imap_open($conn_str, $username, $pw) or die('Cannot connect to mail: ' . imap_last_error());
     /* grab emails */
     $emails = imap_search($inbox, 'SUBJECT "Undeliverable: ' . $subject . '"');
     $failedInfo = [];
     /* if emails are returned, cycle through each... */
     if ($emails) {
         /* for every email... */
         foreach ($emails as $email_number) {
             /* get information specific to this email */
             $body = imap_fetchbody($inbox, $email_number, 2);
             $list = split('; ', $body);
             $sender = $list[2];
             $sender_email = explode("\n", $sender)[0];
             array_push($failedInfo, trim($sender_email));
         }
     }
     /* close the connection */
     imap_close($inbox);
     return $failedInfo;
 }
开发者ID:aanyun,项目名称:PHP-Sample-Code,代码行数:26,代码来源:EmailController.php


示例6: Close

 /**
  * Close the connection to the mail server
  *
  * @param bool $empty_trash (default true) whether to empty the trash upon exit
  *
  */
 function Close($empty_trash = true)
 {
     if ($this->do_delete && $empty_trash) {
         imap_expunge($this->mbox);
     }
     imap_close($this->mbox);
 }
开发者ID:hpazevedo,项目名称:Teste-BDR,代码行数:13,代码来源:Pop3Client.php


示例7: disconnect

 protected function disconnect()
 {
     $imapStream = $this->getImapStream(false);
     if ($imapStream && is_resource($imapStream)) {
         imap_close($imapStream, $this->expungeOnDisconnect ? CL_EXPUNGE : 0);
     }
 }
开发者ID:ladybirdweb,项目名称:momo-email-listener,代码行数:7,代码来源:Mailbox.php


示例8: closeStreamFunc

 public static function closeStreamFunc()
 {
     if (self::$currentStream) {
         AJXP_Logger::debug("Closing stream now!");
         imap_close(self::$currentStream);
     }
 }
开发者ID:biggtfish,项目名称:cms,代码行数:7,代码来源:class.imapAccessWrapper.php


示例9: authenticate_imap

function authenticate_imap($user, $pass)
{
    global $LOGIN_IMAP_CONNECTION;
    global $AUTH_ERR;
    if (hostname() == 'tauceti') {
        $server = '{localhost:143/imap/tls/novalidate-cert}';
    } elseif (hostname() == 'Daneel.dynamic.wondermill.com') {
        $server = '{localhost:143/imap/notls}';
    } else {
        $server = '{localhost:143/imap/tls/novalidate-cert}';
    }
    if ($c = imap_open($server, $user, $pass, OP_HALFOPEN)) {
        if (LOGIN_IMAP_KEEPCONNECTION) {
            $LOGIN_IMAP_CONNECTION =& $c;
        } else {
            //debug('Closing connection');
            imap_close($c);
        }
        return AUTH_SUCCESS;
    } else {
        if ($AUTH_ERR = imap_last_error()) {
            return AUTH_SERVFAIL;
        } else {
            return AUTH_DENY;
        }
    }
}
开发者ID:nbtscommunity,项目名称:phpfnlib,代码行数:27,代码来源:authenticate_imap.php


示例10: readImapStatus

function readImapStatus($config, $savedStatus, $db)
{
    $mbox = imap_open($config["imap_server"], $config["imap_user"], $config["imap_password"]);
    $imapStatus = imap_status($mbox, $config["imap_server"], SA_ALL);
    // Read message IDs of UNSEEN mails
    $unseen = [];
    if ($imapStatus->unseen > 0) {
        $messages = imap_search($mbox, "UNSEEN");
        foreach ($messages as $msgID) {
            $msg = imap_headerinfo($mbox, $msgID);
            $unseen[] = $msg->message_id;
        }
    }
    imap_close($mbox);
    //
    $last_unseen = json_decode($savedStatus->unseen);
    $new_message_found = false;
    foreach ($unseen as $key => $value) {
        // Does 'unseen' contain msgID we haven't seen before?
        if (array_search($value, $last_unseen) === FALSE) {
            $new_message_found = true;
        }
    }
    // Current unseen list doesn't match saved one
    if (count($unseen) != count($last_unseen) || $new_message_found) {
        saveStatusToSqlite($db, "unseen", json_encode($unseen));
    }
    return $new_message_found;
}
开发者ID:McFizh,项目名称:hackster-cc3200-email,代码行数:29,代码来源:common.php


示例11: disconnect

 public function disconnect()
 {
     $imapStream = $this->getImapStream(false);
     if ($imapStream && is_resource($imapStream)) {
         imap_close($imapStream, CL_EXPUNGE);
     }
 }
开发者ID:xepan,项目名称:communication,代码行数:7,代码来源:ImapMailbox.php


示例12: authenticate

 function authenticate($username, $passwd)
 {
     error_reporting(error_reporting() - 2);
     if ($GLOBALS['phpgw_info']['server']['mail_login_type'] == 'vmailmgr') {
         $username = $username . '@' . $GLOBALS['phpgw_info']['server']['mail_suffix'];
     }
     if ($GLOBALS['phpgw_info']['server']['mail_server_type'] == 'imap') {
         $GLOBALS['phpgw_info']['server']['mail_port'] = '143';
     } elseif ($GLOBALS['phpgw_info']['server']['mail_server_type'] == 'pop3') {
         $GLOBALS['phpgw_info']['server']['mail_port'] = '110';
     } elseif ($GLOBALS['phpgw_info']['server']['mail_server_type'] == 'imaps') {
         $GLOBALS['phpgw_info']['server']['mail_port'] = '993';
     } elseif ($GLOBALS['phpgw_info']['server']['mail_server_type'] == 'pop3s') {
         $GLOBALS['phpgw_info']['server']['mail_port'] = '995';
     }
     if ($GLOBALS['phpgw_info']['server']['mail_server_type'] == 'pop3') {
         $mailauth = imap_open('{' . $GLOBALS['phpgw_info']['server']['mail_server'] . '/pop3' . ':' . $GLOBALS['phpgw_info']['server']['mail_port'] . '}INBOX', $username, $passwd);
     } elseif ($GLOBALS['phpgw_info']['server']['mail_server_type'] == 'imaps') {
         // IMAPS support:
         $mailauth = imap_open('{' . $GLOBALS['phpgw_info']['server']['mail_server'] . "/ssl/novalidate-cert" . ':993}INBOX', $username, $passwd);
     } elseif ($GLOBALS['phpgw_info']['server']['mail_server_type'] == 'pop3s') {
         // POP3S support:
         $mailauth = imap_open('{' . $GLOBALS['phpgw_info']['server']['mail_server'] . "/ssl/novalidate-cert" . ':995}INBOX', $username, $passwd);
     } else {
         /* assume imap */
         $mailauth = imap_open('{' . $GLOBALS['phpgw_info']['server']['mail_server'] . ':' . $GLOBALS['phpgw_info']['server']['mail_port'] . '}INBOX', $username, $passwd);
     }
     error_reporting(error_reporting() + 2);
     if ($mailauth == False) {
         return False;
     } else {
         imap_close($mailauth);
         return True;
     }
 }
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:35,代码来源:class.auth_mail.inc.php


示例13: imapclose

 function imapclose()
 {
     if (!$this->mbox) {
         return false;
     }
     @imap_close($this->mbox);
 }
开发者ID:sheagle,项目名称:mailreceiver,代码行数:7,代码来源:cls_email.php


示例14: check

 public function check($touch = false)
 {
     $mbox = $this->connection();
     #echo "<h1>Nachrichten in INBOX</h1><div style=\"overflow:auto;max-height:400px;\"><pre>";
     $MC = imap_check($mbox);
     $T = new HTMLTable(1, $touch ? "Mails" : "");
     $T->setTableStyle("font-size:11px;");
     $T->useForSelection();
     $start = $MC->Nmsgs - 10;
     if ($start < 1) {
         $start = 1;
     }
     $result = imap_fetch_overview($mbox, "{$start}:{$MC->Nmsgs}", 0);
     $result = array_reverse($result);
     foreach ($result as $overview) {
         #print_r($overview);
         $T->addRow(array("\n\t\t\t\t<small style=\"color:grey;float:right;\">" . Util::CLDateParser($overview->udate) . "</small>\n\t\t\t\t" . str_replace("\"", "", $this->decodeBlubb($overview->from)) . "<br />\n\t\t\t\t<small style=\"color:grey;\">" . substr($this->decodeBlubb($overview->subject), 0, 50) . "</small>"));
         $T->addCellEvent(1, "click", "\$j('#MailFrame').attr('src', './interface/rme.php?class=MailCheck&constructor=" . $this->getID() . "&method=showMailBody&parameters=\\'{$overview->uid}\\'');");
     }
     imap_close($mbox);
     #echo "</pre></div>";
     $BC = "";
     if ($touch) {
         $BC = new Button("Fenster\nschließen", "stop");
         $BC->style("float:right;margin:10px;");
         $BC->onclick(OnEvent::closePopup("MailCheck"));
     }
     echo "<div style=\"float:right;width:300px;\">";
     echo $BC;
     echo "<p>{$MC->Nmsgs} Nachricht" . ($MC->Nmsgs == 1 ? "" : "en") . "</p><div style=\"clear:both;\"></div>";
     echo $T;
     echo "</div>";
     echo "\n\t\t\t<div style=\"border-right-style:solid;border-right-width:1px;width:699px;\" class=\"borderColor1\">\n\t\t\t\t<iframe id=\"MailFrame\" style=\"border:0px;width:699px;height:520px;\" src=\"./fheME/MailCheck/Home/index.html\"></iframe>\n\t\t\t</div>";
     echo "<div style=\"clear:both;\"></div>";
 }
开发者ID:nemiah,项目名称:fheME,代码行数:35,代码来源:MailCheckGUI.class.php


示例15: handleJSON_getContent

 function handleJSON_getContent($smarty, $module_name, $appletlist)
 {
     $respuesta = array('status' => 'success', 'message' => '(no message)');
     // Leer credenciales a partir del usuario y el perfil asociado
     global $arrConf;
     $dbAcl = new paloDB($arrConf["elastix_dsn"]["acl"]);
     $pACL = new paloACL($dbAcl);
     $userId = $pACL->getIdUser($_SESSION['elastix_user']);
     $mailCred = $this->leerPropiedadesWebmail($dbAcl, $userId);
     if (count($mailCred) <= 0) {
         $respuesta['status'] = 'error';
         $respuesta['message'] = _tr("You don't have a webmail account");
     } elseif (!$this->_checkEmailPassword("{$mailCred['login']}@{$mailCred['domain']}", isset($mailCred['password']) ? $mailCred['password'] : '')) {
         $respuesta['status'] = 'error';
         $respuesta['message'] = "{$mailCred['login']}@{$mailCred['domain']} " . _tr("does not exist locally or password is incorrect");
     } else {
         $imap = @imap_open("{localhost:143/notls}", "{$mailCred['login']}@{$mailCred['domain']}", isset($mailCred['password']) ? $mailCred['password'] : '');
         if (!$imap) {
             $respuesta['status'] = 'error';
             $respuesta['message'] = _tr('Imap: Connection error');
         } else {
             $this->leerInformacionImap($smarty, $module_name, $imap, $respuesta);
             imap_close($imap);
         }
     }
     $json = new Services_JSON();
     Header('Content-Type: application/json');
     return $json->encode($respuesta);
 }
开发者ID:hardikk,项目名称:HNH,代码行数:29,代码来源:index.php


示例16: __destruct

 function __destruct()
 {
     // You will have iMap errors, even if there are no
     // mails on the server.  This suppresses that error.
     imap_errors();
     imap_close($this->connection);
 }
开发者ID:jmahmood,项目名称:MixiPOP3,代码行数:7,代码来源:pop3.php


示例17: close

 public function close()
 {
     if ($this->isOpen()) {
         imap_close($this->_imapStream, CL_EXPUNGE);
         $this->_open = false;
     }
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:7,代码来源:EmailTestingUtil.php


示例18: __destruct

 public function __destruct()
 {
     if (!$this->resource) {
         return;
     }
     imap_close($this->resource);
 }
开发者ID:philip,项目名称:flourish,代码行数:7,代码来源:Imap.php


示例19: GetIMAPContent

 /**
  * Gets IMAP content
  *
  * @param string $imapHost
  * @param string $imapUser
  * @param string $imapPassword
  * @param \Swiftriver\Core\ObjectModel\Channel $channel
  *
  * @return $contentItems[]
  */
 private function GetIMAPContent($imapHost, $imapUser, $imapPassword, $channel)
 {
     $imapResource = imap_open("{" . $imapHost . "}INBOX", $imapUser, $imapPassword);
     //Open up unseen messages
     $search = $channel->lastSuccess == null ? "UNSEEN" : "UNSEEN SINCE " . \date("Y-m-d", $channel->lastSuccess);
     $imapEmails = imap_search($imapResource, $search);
     $contentItems = array();
     if ($imapEmails) {
         //Put newest emails on top
         rsort($imapEmails);
         foreach ($imapEmails as $Email) {
             //Loop through each email and return the content
             $email_overview = imap_fetch_overview($imapResource, $Email, 0);
             if (strtotime(reset($email_overview)->date) < $channel->lastSuccess) {
                 continue;
             }
             $email_header_info = imap_header($imapResource, $Email);
             $email_message = imap_fetchbody($imapResource, $Email, 1);
             $source_name = \reset($email_overview)->from;
             $source = \Swiftriver\Core\ObjectModel\ObjectFactories\SourceFactory::CreateSourceFromIdentifier($source_name);
             $source->name = $source_name;
             $source->parent = $channel->id;
             $source->type = $channel->type;
             $source->subType = $channel->subType;
             $item = \Swiftriver\Core\ObjectModel\ObjectFactories\ContentFactory::CreateContent($source);
             $item->text[] = new \Swiftriver\Core\ObjectModel\LanguageSpecificText(null, $email_overview[0]->subject, array($email_message));
             //the message
             $item->link = null;
             $item->date = $email_header_info->udate;
             $contentItems[] = $item;
         }
     }
     imap_close($imapResource);
     return $contentItems;
 }
开发者ID:Bridgeborn,项目名称:Swiftriver,代码行数:45,代码来源:IMAPParser.php


示例20: fetch

 public function fetch(MailCriteria $criteria, $callback)
 {
     $mailbox = @imap_open('{' . $this->host . ':' . $this->port . '}INBOX', $this->username, $this->password);
     if (!$mailbox) {
         throw new ImapException("Cannot connect to imap server: {$this->host}:{$this->port}'");
     }
     $this->checkProcessedFolder($mailbox);
     $emails = $this->fetchEmails($mailbox, $criteria);
     if ($emails) {
         foreach ($emails as $emailIndex) {
             $overview = imap_fetch_overview($mailbox, $emailIndex, 0);
             $message = imap_body($mailbox, $emailIndex);
             $email = new Email($overview, $message);
             $processed = $callback($email);
             if ($processed) {
                 $res = imap_mail_move($mailbox, $emailIndex, $this->processedFolder);
                 if (!$res) {
                     throw new \Exception("Unexpected error: Cannot move email to ");
                     break;
                 }
             }
         }
     }
     @imap_close($mailbox);
 }
开发者ID:martinstrycek,项目名称:imap-mail-downloader,代码行数:25,代码来源:Downloader.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP imap_createmailbox函数代码示例发布时间:2022-05-15
下一篇:
PHP imap_clearflag_full函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap