PHP: imap_rfc822_parse_headers - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

imap_rfc822_write_address imap_rfc822_parse_adrlist

Last updated: Fri, 26 Jan 2007

view this page in

# imap_rfc822_parse_headers

(PHP 4, PHP 5)

imap_rfc822_parse_headers -- Parse mail headers from a string

## Описание

object imap_rfc822_parse_headers ( string headers [, string defaulthost] )

Gets an object of various header elements, similar to imap_header().

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

`headers`

  The parsed headers data

`defaulthost`

  The default host name

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

Returns an object similar to the one returned by imap_header(), except for the flags and other properties that come from the IMAP server.

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

imap_rfc822_parse_adrlist()

add a note User Contributed Notes
imap_rfc822_parse_headers
Oliver
15-Apr-2006 05:50
`To see the content of the returned object try this code:
$stream = imap_open($server, $username, $password);
$header = imap_fetchheader($stream, $uid, FT_UID);
$obj = imap_rfc822_parse_headers( $header);
print "<html><head></head><body><pre>\n";
print_r($obj);
print "</pre></body></html>";
imap_close($stream);`
Kevin Casper <casperke at gmail dot com>
01-Feb-2005 10:23
`I was lightly probing this function's behavoir.
It handles rfc882 fields:
date
subject
message_id
to
from
reply-to
sender - will generate using 'from' field if not in
header
references
in-reply-to
cc
doesn't handle rfc882 fields:
return-path
received
resent- I think this field may be obsolete
keywords
If there are other rfc822 fields or behavoirs for the function, then I can't speak of them as they weren't in my test.
As it is relevent to what I'm currently doing I may add more about this function from time to time.`
jh at junetz dot de
14-Sep-2004 08:22
`But what you /will/ get is a complete To field, i.e. unfolded as specified for long header fields in RFC 822. So if you want to replace imap_headerinfo() by this function, you can run it on imap_fetchheader().`
Sven dot Dickert at planb dot de
21-May-2002 04:28
`The object you get from imap_rfc822_parse_headers differs from the object you get from imap_headerinfo/imap_header in the following points. You won't get the:
* flags
* msgno
* size
* Maildate
* udate
* fetchfrom
* fetchsubject
udate can be simulated with
$headerobj=imap_rfc822_parse_headers ($header);
$udate=strtotime($headerobj->date);`
add a note
imap_rfc822_write_address imap_rfc822_parse_adrlist

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST