uTools-Manuals/docs/php/imap_fetchstructure.html
2019-04-08 23:22:26 +08:00

255 lines
7.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Read the structure of a particular message</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.imap-fetchstructure" class="refentry">
<div class="refnamediv">
<h1 class="refname">imap_fetchstructure</h1>
<p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">imap_fetchstructure</span> &mdash; <span class="dc-title">Read the structure of a particular message</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.imap-fetchstructure-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>imap_fetchstructure</strong></span>
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$imap_stream</code></span>
, <span class="methodparam"><span class="type">int</span> <code class="parameter">$msg_number</code></span>
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$options</code><span class="initializer"> = 0</span></span>
] ) : <span class="type">object</span></div>
<p class="para rdfs-comment">
Fetches all the structured information for a given message.
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.imap-fetchstructure-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">
imap_stream</code></dt>
<dd>
<p class="para"><span class="function"><a href="imap_open.html" class="function">imap_open()</a></span> 返回的 IMAP 流。</p></dd>
<dt>
<code class="parameter">msg_number</code></dt>
<dd>
<p class="para">
The message number
</p>
</dd>
<dt>
<code class="parameter">options</code></dt>
<dd>
<p class="para">
This optional parameter only has a single option,
<strong><code>FT_UID</code></strong>, which tells the function to treat the
<code class="parameter">msg_number</code> argument as a
<em>UID</em>.
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.imap-fetchstructure-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
Returns an object includes the envelope, internal date, size, flags and
body structure along with a similar object for each mime attachment. The
structure of the returned objects is as follows:
</p>
<p class="para">
<table class="doctable table">
<caption><strong>
Returned Objects for <span class="function"><strong>imap_fetchstructure()</strong></span>
</strong></caption>
<tbody class="tbody">
<tr>
<td>type</td>
<td>Primary body type</td>
</tr>
<tr>
<td>encoding</td>
<td>Body transfer encoding</td>
</tr>
<tr>
<td>ifsubtype</td>
<td><strong><code>TRUE</code></strong> if there is a subtype string</td>
</tr>
<tr>
<td>subtype</td>
<td><acronym title="Multipurpose Internet Mail Extensions">MIME</acronym> subtype</td>
</tr>
<tr>
<td>ifdescription</td>
<td><strong><code>TRUE</code></strong> if there is a description string</td>
</tr>
<tr>
<td>description</td>
<td>Content description string</td>
</tr>
<tr>
<td>ifid</td>
<td><strong><code>TRUE</code></strong> if there is an identification string</td>
</tr>
<tr>
<td>id</td>
<td>Identification string</td>
</tr>
<tr>
<td>lines</td>
<td>Number of lines</td>
</tr>
<tr>
<td>bytes</td>
<td>Number of bytes</td>
</tr>
<tr>
<td>ifdisposition</td>
<td><strong><code>TRUE</code></strong> if there is a disposition string</td>
</tr>
<tr>
<td>disposition</td>
<td>Disposition string</td>
</tr>
<tr>
<td>ifdparameters</td>
<td><strong><code>TRUE</code></strong> if the <var class="varname"><var class="varname">dparameters</var></var> array exists</td>
</tr>
<tr>
<td>dparameters</td>
<td>An array of objects where each object has an
<em>&quot;attribute&quot;</em> and a <em>&quot;value&quot;</em>
property corresponding to the parameters on the
<em>Content-disposition</em> <acronym title="Multipurpose Internet Mail Extensions">MIME</acronym>
header.</td>
</tr>
<tr>
<td>ifparameters</td>
<td><strong><code>TRUE</code></strong> if the parameters array exists</td>
</tr>
<tr>
<td>parameters</td>
<td>An array of objects where each object has an
<em>&quot;attribute&quot;</em> and a <em>&quot;value&quot;</em>
property.</td>
</tr>
<tr>
<td>parts</td>
<td>An array of objects identical in structure to the top-level
object, each of which corresponds to a <acronym title="Multipurpose Internet Mail Extensions">MIME</acronym> body
part.</td>
</tr>
</tbody>
</table>
</p>
<p class="para">
<table class="doctable table">
<caption><strong>Primary body type (value may vary with used library, use of constants is recommended)</strong></caption>
<thead>
<tr><th>Value</th><th>Type</th><th>Constant</th></tr>
</thead>
<tbody class="tbody">
<tr><td>0</td><td>text</td><td>TYPETEXT</td></tr>
<tr><td>1</td><td>multipart</td><td>TYPEMULTIPART</td></tr>
<tr><td>2</td><td>message</td><td>TYPEMESSAGE</td></tr>
<tr><td>3</td><td>application</td><td>TYPEAPPLICATION</td></tr>
<tr><td>4</td><td>audio</td><td>TYPEAUDIO</td></tr>
<tr><td>5</td><td>image</td><td>TYPEIMAGE</td></tr>
<tr><td>6</td><td>video</td><td>TYPEVIDEO</td></tr>
<tr><td>7</td><td>model</td><td>TYPEMODEL</td></tr>
<tr><td>8</td><td>other</td><td>TYPEOTHER</td></tr>
</tbody>
</table>
</p>
<p class="para">
<table class="doctable table">
<caption><strong>Transfer encodings (value may vary with used library, use of constants is recommended)</strong></caption>
<thead>
<tr><th>Value</th><th>Type</th><th>Constant</th></tr>
</thead>
<tbody class="tbody">
<tr><td>0</td><td>7bit</td><td>ENC7BIT</td></tr>
<tr><td>1</td><td>8bit</td><td>ENC8BIT</td></tr>
<tr><td>2</td><td>Binary</td><td>ENCBINARY</td></tr>
<tr><td>3</td><td>Base64</td><td>ENCBASE64</td></tr>
<tr><td>4</td><td>Quoted-Printable</td><td>ENCQUOTEDPRINTABLE</td></tr>
<tr><td>5</td><td>other</td><td>ENCOTHER</td></tr>
</tbody>
</table>
</p>
</div>
<div class="refsect1 seealso" id="refsect1-function.imap-fetchstructure-seealso">
<h3 class="title">参见</h3>
<p class="para">
<ul class="simplelist">
<li class="member"><span class="function"><a href="imap_fetchbody.html" class="function" rel="rdfs-seeAlso">imap_fetchbody()</a> - Fetch a particular section of the body of the message</span></li>
<li class="member"><span class="function"><a href="imap_bodystruct.html" class="function" rel="rdfs-seeAlso">imap_bodystruct()</a> - Read the structure of a specified body section of a specific message</span></li>
</ul>
</p>
</div>
</div></div></div></body></html>