Web студия "GrandView"
  Главная   Написать Контакты
   
   
О проекте
Руководство php
 

imap_fetchheader

(PHP 3 >= 3.0.3, PHP 4, PHP 5)

imap_fetchheader -- Returns header for a message

Описание

string imap_fetchheader ( resource imap_stream, int msg_number [, int options] )

This function causes a fetch of the complete, unfiltered RFC2822 format header of the specified message.

Список параметров

imap_stream

An IMAP stream returned by imap_open().

msg_number

The message number

options

The possible options are:

  • FT_UID - The msgno argument is a UID

  • FT_INTERNAL - The return string is in "internal" format, without any attempt to canonicalize to CRLF newlines

  • FT_PREFETCHTEXT - The RFC822.TEXT should be pre-fetched at the same time. This avoids an extra RTT on an IMAP connection if a full message text is desired (e.g. in a "save to local file" operation)

Возвращаемые значения

Returns the header of the specified message as a text string.

Смотрите также

imap_fetch_overview()



add a note add a note User Contributed Notes
imap_fetchheader
Max Geiger
08-Mar-2007 03:59
If you call the function with the bitmask-parameter FT_PREFETCHTEXT the /Seen flag of the message will be set.
dj_doktor at upskirt dot cz
03-Apr-2005 07:17
I spend lot of time find out how I can detect messages with
different priorities. When I read users notes I remember
function imap_fetchheader which show header of message
and additional headers too. Because I'm so lazy to work with
regular expressions I required my frend for writing code
- thanx Znouza.
And there is... :)

<?php
   
// connecting to imap mailserver
   
$connection = @imap_open("{localhost:143/imap}INBOX", "your_username", "your_password");

   
// get imap_fetch header and put single lines into array
   
$header = explode("\n", imap_fetchheader($connection, 1));

   
// browse array for additional headers
   
if (is_array($header) && count($header)) {
       
$head = array();
        foreach(
$header as $line) {
           
// is line with additional header?
           
if (eregi("^X-", $line)) {
               
// separate name and value
               
eregi("^([^:]*): (.*)", $line, $arg);
               
$head[$arg[1]] = $arg[2];
            }
        }
    }

   
// now are all contained additional headers in array $head
?>

imap_fetchstructure> <imap_fetchbody
Last updated: Fri, 26 Jan 2007
 
 
Новости
11 июля 2007
Сайт запущен
© 2007 info@grandviewstudio.com

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/sites/grandviewstudiocom/www/65f67d67a94ad980786580ae69e11c07/sape.php on line 324

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/sites/grandviewstudiocom/www/65f67d67a94ad980786580ae69e11c07/sape.php on line 330
Z058440144362 Z348613067571