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

PHP imap_headers函数代码示例

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

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



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

示例1: messages

 public function messages($options = true)
 {
     if (is_bool($options)) {
         $options = array('seen' => $options);
     }
     $options = self::options($options, array('offset' => 0, 'limit' => 0, 'seen' => true, 'newestFirst' => true));
     $IMAPMessageClass = $this->IMAPMessageClass;
     $headers = imap_headers($this->mbox);
     if ($options['newestFirst']) {
         $headers = array_reverse($headers);
     }
     $messages = array();
     $eligables = 0;
     foreach ($headers as $n => $header) {
         if (preg_match('/(U?)\\s+(\\d+)\\)/', $header, $match)) {
             $unseen = (bool) trim($match[1]);
             $msgNum = (int) $match[2];
             $eligable = $options['seen'] || $unseen;
             if ($eligable) {
                 $eligables++;
             }
             if ($eligable) {
                 if ($eligables > $options['offset']) {
                     if (!$options['limit'] || !isset($messages[$options['limit'] - 1])) {
                         $messages[] = new $IMAPMessageClass($this, $msgNum, $header, $unseen);
                     }
                 }
             }
             if ($options['limit'] && isset($messages[$options['limit'] - 1])) {
                 break;
             }
         }
     }
     return $messages;
 }
开发者ID:renatomartins,项目名称:cognosys,代码行数:35,代码来源:IMAP.php


示例2: 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


示例3: total

 public function total()
 {
     if (!$this->box) {
         return 0;
     } else {
         return count(imap_headers($this->box));
     }
 }
开发者ID:tricardo,项目名称:CartorioPostal_old,代码行数:8,代码来源:ReceiveImapDAO.php


示例4: imapcount

 function imapcount()
 {
     if (!$this->mbox) {
         return false;
     }
     $headers = imap_headers($this->mbox);
     return count($headers);
 }
开发者ID:sheagle,项目名称:mailreceiver,代码行数:8,代码来源:cls_email.php


示例5: __imap_count_mail

 function __imap_count_mail()
 {
     $this->headers = @imap_headers($this->conn);
     if (!empty($this->headers)) {
         return sizeof($this->headers);
     } else {
         return $this->imap_get_last_error();
     }
 }
开发者ID:hardikamutech,项目名称:campaign,代码行数:9,代码来源:_imap_helper.php


示例6: listMessages

 function listMessages()
 {
     return imap_headers($this->stream);
 }
开发者ID:kam1katze,项目名称:ocDashboard,代码行数:4,代码来源:imap.php


示例7: getTotalMails

 function getTotalMails()
 {
     $headers = imap_headers($this->marubox);
     return count($headers);
 }
开发者ID:rusoftware,项目名称:_NewSite,代码行数:5,代码来源:receivemail.class.php


示例8: imap_open

<?php

// open IMAP connection
$mail = imap_open('{mail.server.com:143}', 'username', 'password');
// or, open POP3 connection
$mail = imap_open('{mail.server.com:110/pop3}', 'username', 'password');
// grab a list of all the mail headers
$headers = imap_headers($mail);
// grab a header object for the last message in the mailbox
$last = imap_num_msg($mail);
$header = imap_header($mail, $last);
// grab the body for the same message
$body = imap_body($mail, $last);
// close the connection
imap_close($mail);
开发者ID:zmwebdev,项目名称:PHPcookbook-code-3ed,代码行数:15,代码来源:imap-pop-read.php


示例9: cw_order_messages_get_emails

function cw_order_messages_get_emails($time, $prev_time)
{
    global $tables, $config;
    global $take_messages_debug;
    /*
    $config['order_messages']['contact_email_access_info'] = '{pop.gmail.com:995/novalidate-cert/pop3/ssl}INBOX';
    */
    $mail = imap_open($config['order_messages']['contact_email_access_info'], $config['order_messages']['contact_email_address'], $config['order_messages']['contact_email_password']);
    /*cw_log_add("order_messages_get_emails",array('contact_email_access_info'=>$config['order_messages']['contact_email_access_info'],
      'contact_email_address'=>$config['order_messages']['contact_email_address'],
      'contact_email_password'=>'--hidden--'));*/
    if (!$mail) {
        //cw_log_add("order_messages_get_emails", array("imap last error: "=>imap_last_error()));
        if ($take_messages_debug == 'Y') {
            print_r(array("order_messages_get_emails", array("imap last error: " => imap_last_error())));
            print "<br>";
        }
    } else {
        if ($take_messages_debug == 'Y') {
            print_r(array("order_messages_get_emails", array("imap last error: " => imap_last_error(), "mail_obj" => $mail)));
            print "<br>";
        }
    }
    $last_mail_id = cw_query_first_cell("select max(mail_id) from {$tables['mail_rpool']}");
    if ($mail) {
        $headers = imap_headers($mail);
        if (!empty($headers)) {
            $curr_message_id = imap_num_msg($mail);
            while ($curr_message_id > 0) {
                $header = imap_header($mail, $curr_message_id);
                //do not save emails from anyone else but users
                $from = $header->from;
                foreach ($from as $id => $object) {
                    $emailfrom = $object->mailbox . "@" . $object->host;
                }
                $is_users_email = cw_query_first_cell("select count(*) from {$tables['customers']} where email='" . addslashes($emailfrom) . "'");
                if (!$is_users_email) {
                    $curr_message_id--;
                    continue;
                }
                // pull the plain text for message $n
                $st = imap_fetchstructure($mail, $curr_message_id);
                if (!empty($st->parts)) {
                    for ($i = 0, $j = count($st->parts); $i < $j; $i++) {
                        $part = $st->parts[$i];
                        if ($part->subtype == 'PLAIN') {
                            $body = imap_fetchbody($mail, $curr_message_id, $i + 1);
                        }
                    }
                } else {
                    $body = imap_body($mail, $curr_message_id);
                }
                $body = preg_replace('#(^\\w.+:\\n)?(^>.*(\\n|$))+#mi', "", $body);
                cw_array2insert('mail_rpool', array('header' => serialize($header), 'body' => addslashes($body), 'subject' => $header->subject, 'mail_from' => addslashes($emailfrom), 'mail_to' => $header->toaddress));
                cw_log_add('mail_rpool', array('header' => $header, 'subject' => $header->subject, 'mail_from' => $emailfrom, 'mail_to' => $header->toaddress, 'body' => $body));
                $curr_message_id--;
            }
        }
        imap_close($mail);
    }
    if ($last_mail_id) {
        $last_mail_id_condition = " where mail_id > '{$last_mail_id}' ";
    }
    if ($take_messages_debug != 'Y') {
        cw_order_messages_process_new_emails($last_mail_id_condition);
    }
    return;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:68,代码来源:func.php


示例10: getTotalMails

 /**
  * Used to get total unread mail from that mailbox
  *
  * @return an integer (Total Mail)
  **/
 function getTotalMails()
 {
     //Get Total Number off Unread Email In Mailbox
     $headers = imap_headers($this->marubox);
     return count($headers);
 }
开发者ID:remicollet,项目名称:glpi,代码行数:11,代码来源:mailcollector.class.php


示例11: imap_listmailbox

         } else {
             echo 'Не удалось открыть ящик';
         }
     }
     // if
     break;
     //////////////////////////////////////////////////
 //////////////////////////////////////////////////
 case 'mailboxes':
     // нет параметров
 // нет параметров
 case 'headers':
     // нет параметров
     //////////////////////////////////////////////////
     if ($mbi) {
         $r = $cmd == 'mailboxes' ? imap_listmailbox($mbi, $ibox['mailbox'], '*') : imap_headers($mbi);
         if ($r) {
             while (list($key, $val) = each($r)) {
                 echo "{$val}\n";
             }
         } else {
             echo 'Не получилось';
         }
     }
     // if
     break;
     //////////////////////////////////////////////////
 //////////////////////////////////////////////////
 case 'header':
     // $params - номер письма
     //////////////////////////////////////////////////
开发者ID:pombredanne,项目名称:lishnih,代码行数:31,代码来源:app_imap.php


示例12: imapHeaders

 /**
  * liefert die Mailheader
  * @return array
  */
 public function imapHeaders()
 {
     if ($this->imap === null) {
         throw new IMAPException(__METHOD__ . ' not connected');
     }
     $this->imapPing(true);
     return imap_headers($this->imap);
 }
开发者ID:NEOatNHNG,项目名称:cacert-testmgr,代码行数:12,代码来源:imapConnection.php


示例13: get_list

function get_list($imap)
{
    // get the list of messages in this mailbox
    $headers = imap_headers($imap);
    $messages = sizeof($headers);
    for ($i = 0; $i < $messages; $i++) {
        echo $headers[$i];
    }
    imap_close($imap);
}
开发者ID:andersonbporto,项目名称:programacao_internet_2015_1,代码行数:10,代码来源:mail_fns.php


示例14: getNumUnreadEmails

 function getNumUnreadEmails()
 {
     $headers = imap_headers($this->mailbox);
     return count($headers);
 }
开发者ID:sitracker,项目名称:sitracker_old,代码行数:5,代码来源:fetchSitMail.class.php


示例15: getTotalMails

 /**
  * Get Total Number off Unread Email In Mailbox
  * @return bool|int
  */
 public function getTotalMails()
 {
     if (!$this->marubox) {
         return false;
     } else {
         $headers = imap_headers($this->marubox);
         return count($headers);
     }
 }
开发者ID:lovecheng,项目名称:brs-demo2,代码行数:13,代码来源:Email.php


示例16: display_list

function display_list($auth_user, $accountid)
{
    // show the list of messages in this mailbox
    global $table_width;
    if (!$accountid) {
        echo 'No mailbox selected<br /><br /><br /><br /><br /><br />.';
    } else {
        $imap = open_mailbox($auth_user, $accountid);
        if ($imap) {
            echo "<table width = {$table_width} cellspacing = 0 \n                   cellpadding = 6  border = 0>";
            $headers = imap_headers($imap);
            // we could reformat this data, or get other details using
            // imap_fetchheaders, but this is not a bad summary so we just echo each
            $messages = sizeof($headers);
            for ($i = 0; $i < $messages; $i++) {
                echo '<tr><td bgcolor = "';
                if ($i % 2) {
                    echo '#ffffff';
                } else {
                    echo '#ffffcc';
                }
                echo '"><a href ="index.php?action=view-message&messageid=' . ($i + 1) . '">';
                echo $headers[$i];
                echo "</a></td></tr>\n";
            }
            echo '</table>';
        } else {
            $account = get_account_settings($auth_user, $accountid);
            echo 'could not open mail box ' . $account['server'] . '.<br /><br /><br /><br />';
        }
    }
}
开发者ID:sjaviel,项目名称:programacao_internet_2015_2,代码行数:32,代码来源:output_fns.php


示例17: display_list

function display_list($auth_user, $accountid)
{
    //    echo "Debug: display_list()<br />";
    global $table_width;
    //debug $accountid -> $accountid[0]
    $counter = 0;
    //    echo "Debug: counter: ".$counter."<br />";
    if (!$accountid) {
        echo "<p style=\"padding-bottom: 100px\">Mailbox is not selected.</p>";
    } else {
        $imap = open_mailbox($auth_user, $accountid);
        if ($imap) {
            echo "<table width=\"" . $table_width . "\" cellspacing=\"0\"\n                cellpadding=\"6\" border=\"0\">";
            $headers = imap_headers($imap);
            $messages = sizeof($headers);
            for ($i = 0; $i < $messages; $i++) {
                echo "<tr><td bgcolor=\"";
                if ($i % 2) {
                    echo '#ffffff';
                } else {
                    echo '#ffffcc';
                }
                echo "\"><a href=\"index.php?action=view-message&messageid=" . ($i + 1) . "\">";
                echo $headers[$i];
                echo "</a></td></tr>\n";
            }
            echo "</table>";
        } else {
            $account = get_account_settings($auth_user, $accountid);
            echo "<p style=\"padding-bottom: 100px\">Can\\'t open mailbox" . $account['server'] . ".</p>";
        }
    }
}
开发者ID:Carteor,项目名称:warmmail-php,代码行数:33,代码来源:output_fns.php


示例18: imap_open

 <?php 
$mb = imap_open("{my.imap.com.tw}INBOX", "wilson", "mypasswd");
$AllHeaders = imap_headers($mb);
imap_close($mb);
echo "<pre>\n";
for ($i = 0; $i < count($AllHeaders); $i++) {
    echo $AllHeaders[$i] . "<p><hr><p>\n";
}
echo "</pre>\n";
?>
 
开发者ID:shiyake,项目名称:PHP,代码行数:10,代码来源:imap.php


示例19: GetQuickHeaders

 /**
  * Returns an array containing summary information about the messages.
  * Use this function to list messages without downloading the entire
  * contents of each one
  * @return Array
  */
 function GetQuickHeaders()
 {
     return imap_headers($this->mbox);
 }
开发者ID:hpazevedo,项目名称:Teste-BDR,代码行数:10,代码来源:Pop3Client.php


示例20: header

<?php

use rdx\imap\IMAPMailbox;
require 'env.php';
require 'autoload.php';
header('Content-type: text/plain');
$mbox = new IMAPMailbox(IMAP_HELPDESK_HOST, IMAP_HELPDESK_USER, IMAP_HELPDESK_PASS, 'INBOX', ['novalidate-cert']);
print_r($mbox->headers());
$messages = $mbox->messages();
var_dump(count($messages));
print_r($messages);
exit;
$headers = imap_headers($mbox);
print_r($headers);
foreach ($headers as $hd) {
    if (preg_match('/(\\d+)\\)/', $hd, $match)) {
        $msgNum = $match[1];
        $hd = imap_headerinfo($mbox, $msgNum);
        $new = !!trim($hd->Unseen);
        if ($new) {
            // subject -- should contain #code#
            $title = get_plain_text_subject($mbox, $msgNum, $hd);
            $code = preg_match('/#(\\d+)#$/', $title, $match) ? (int) $match[1] : 0;
            echo $title . "\n";
            // body -- get only last part (no conversation history)
            $attachments = array();
            $full_body = get_plain_text_body($mbox, $msgNum, $attachments);
            $body = get_last_body_part($full_body);
            if ($attachments) {
                $body .= "\n\n== Attachments:\n* " . implode("\n* ", $attachments);
            }
开发者ID:rudiedirkx,项目名称:IMAP-reader,代码行数:31,代码来源:test.br-autohelpdesk.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP imap_last_error函数代码示例发布时间:2022-05-15
下一篇:
PHP imap_headerinfo函数代码示例发布时间: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