<HTML ><HEAD ><TITLE >imap_header</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK REL="HOME" TITLE="PHP Manual" HREF="manual.html"><LINK REL="UP" TITLE="IMAP, POP3 and NNTP functions" HREF="ref.imap.html"><LINK REL="PREVIOUS" TITLE="imap_fetchstructure" HREF="function.imap-fetchstructure.html"><LINK REL="NEXT" TITLE="imap_headers" HREF="function.imap-headers.html"></HEAD ><BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.imap-fetchstructure.html" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.imap-headers.html" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.imap-header" >imap_header</A ></H1 ><DIV CLASS="refnamediv" ><A NAME="AEN12925" ></A >imap_header -- Read the header of the message</DIV ><DIV CLASS="refsect1" ><A NAME="AEN12928" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><P ></P ><CODE CLASS="FUNCDEF" >object imap_header</CODE >(int imap_stream, int msg_number, int [<SPAN CLASS="optional" >fromlength</SPAN >] , int [<SPAN CLASS="optional" >subjectlength</SPAN >] , string [<SPAN CLASS="optional" >defaulthost</SPAN >] );<P ></P ></DIV ><P > This function returns an object of various header elements. </P ><P > <DIV CLASS="informalexample" ><P ></P ><P CLASS="literallayout" ><br> remail, date, Date, subject, Subject, in_reply_to, message_id,<br> newsgroups, followup_to, references<br> <br> message flags:<br> Recent - 'R' if recent and seen, <br> 'N' if recent and not seen, <br> ' ' if not recent<br> Unseen - 'U' if not seen AND not recent, <br> ' ' if seen OR not seen and recent<br> Answered -'A' if answered, <br> ' ' if unanswered<br> Deleted - 'D' if deleted, <br> ' ' if not deleted<br> Draft - 'X' if draft, <br> ' ' if not draft<br> Flagged - 'F' if flagged, <br> ' ' if not flagged<br> <br> NOTE that the Recent/Unseen behavior is a little odd. If you want to<br> know if a message is Unseen, you must check for<br> <br> Unseen == 'U' || Recent == 'N'<br> <br> toaddress (full to: line, up to 1024 characters)<br> <br> to[] (returns an array of objects from the To line, containing):<br> personal<br> adl<br> mailbox<br> host<br> <br> fromaddress (full from: line, up to 1024 characters)<br> <br> from[] (returns an array of objects from the From line, containing):<br> personal<br> adl<br> mailbox<br> host<br> <br> ccaddress (full cc: line, up to 1024 characters)<br> cc[] (returns an array of objects from the Cc line, containing):<br> personal<br> adl<br> mailbox<br> host<br> <br> bccaddress (full bcc line, up to 1024 characters)<br> bcc[] (returns an array of objects from the Bcc line, containing):<br> personal<br> adl<br> mailbox<br> host<br> <br> reply_toaddress (full reply_to: line, up to 1024 characters)<br> reply_to[] (returns an array of objects from the Reply_to line,<br> containing):<br> personal<br> adl<br> mailbox<br> host<br> <br> senderaddress (full sender: line, up to 1024 characters)<br> sender[] (returns an array of objects from the sender line, containing):<br> personal<br> adl<br> mailbox<br> host<br> <br> return_path (full return-path: line, up to 1024 characters)<br> return_path[] (returns an array of objects from the return_path line,<br> containing):<br> personal<br> adl<br> mailbox<br> host<br> <br> udate (mail message date in unix time)<br> <br> fetchfrom (from line formatted to fit <TT CLASS="parameter" ><I >fromlength</I ></TT > <br> characters)<br> <br> fetchsubject (subject line formatted to fit <TT CLASS="parameter" ><I >subjectlength</I ></TT > characters)<br> </P ><P ></P ></DIV > </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.imap-fetchstructure.html" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="manual.html" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.imap-headers.html" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >imap_fetchstructure</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.imap.html" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >imap_headers</TD ></TR ></TABLE ></DIV ></BODY ></HTML >