📄 function.imap-open.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Open an IMAP stream to a mailbox</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.imap-num-recent.html">imap_num_recent</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.imap-ping.html">imap_ping</a></div> <div class="up"><a href="ref.imap.html">IMAP Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.imap-open" class="refentry"> <div class="refnamediv"> <h1 class="refname">imap_open</h1> <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">imap_open</span> — <span class="dc-title">Open an IMAP stream to a mailbox</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">resource</span> <span class="methodname"><b><b>imap_open</b></b></span> ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$mailbox</tt></span> , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$username</tt></span> , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$password</tt></span> [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$options</tt></span> [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$n_retries</tt></span> ]] )</div> <p class="para rdfs-comment"> Opens an IMAP stream to a <i><tt class="parameter">mailbox</tt></i>. </p> <p class="para"> This function can also be used to open streams to POP3 and NNTP servers, but some functions and features are only available on IMAP servers. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">mailbox</tt></i></span> <dd> <p class="para"> A mailbox name consists of a server and a mailbox path on this server. The special name <i>INBOX</i> stands for the current users personal mailbox. Mailbox names that contain international characters besides those in the printable ASCII space have to be encoded width <a href="function.imap-utf7-encode.html" class="function">imap_utf7_encode()</a>. </p> <p class="para"> The server part, which is enclosed in '{' and '}', consists of the servers name or ip address, an optional port (prefixed by ':'), and an optional protocol specification (prefixed by '/'). </p> <p class="para"> The server part is mandatory in all mailbox parameters. </p> <p class="para"> All names which start with <i>{</i> are remote names, and are in the form <i>"{" remote_system_name [":" port] [flags] "}" [mailbox_name]</i> where: <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"> <i>remote_system_name</i> - Internet domain name or bracketed IP address of server. </span> </li> <li class="listitem"> <span class="simpara"> <i>port</i> - optional TCP port number, default is the default port for that service </span> </li> <li class="listitem"> <span class="simpara"> <i>flags</i> - optional flags, see following table. </span> </li> <li class="listitem"> <span class="simpara"> <i>mailbox_name</i> - remote mailbox name, default is INBOX </span> </li> </ul> </p> <p class="para"> <table border="5"> <caption><b>Optional flags for names</b></caption> <colgroup> <thead valign="middle"> <tr valign="middle"> <th colspan="1">Flag</th> <th colspan="1">Description</th> </tr> </thead> <tbody valign="middle" class="tbody"> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/service=</i><em class="emphasis">service</em></td> <td colspan="1" rowspan="1" align="left">mailbox access service, default is "imap"</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/user=</i><em class="emphasis">user</em></td> <td colspan="1" rowspan="1" align="left">remote user name for login on the server</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/authuser=</i><em class="emphasis">user</em></td> <td colspan="1" rowspan="1" align="left">remote authentication user; if specified this is the user name whose password is used (e.g. administrator)</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/anonymous</i></td> <td colspan="1" rowspan="1" align="left">remote access as anonymous user</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/debug</i></td> <td colspan="1" rowspan="1" align="left">record protocol telemetry in application's debug log</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/secure</i></td> <td colspan="1" rowspan="1" align="left">do not transmit a plaintext password over the network</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/imap</i>, <i>/imap2</i>, <i>/imap2bis</i>, <i>/imap4</i>, <i>/imap4rev1</i></td> <td colspan="1" rowspan="1" align="left">equivalent to /service=imap</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/pop3</i></td> <td colspan="1" rowspan="1" align="left">equivalent to /service=pop3</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/nntp</i></td> <td colspan="1" rowspan="1" align="left">equivalent to /service=nntp</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/norsh</i></td> <td colspan="1" rowspan="1" align="left">do not use rsh or ssh to establish a preauthenticated IMAP session</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/ssl</i></td> <td colspan="1" rowspan="1" align="left">use the Secure Socket Layer to encrypt the session</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/validate-cert</i></td> <td colspan="1" rowspan="1" align="left">validate certificates from TLS/SSL server (this is the default behavior)</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/novalidate-cert</i></td> <td colspan="1" rowspan="1" align="left">do not validate certificates from TLS/SSL server, needed if server uses self-signed certificates</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/tls</i></td> <td colspan="1" rowspan="1" align="left">force use of start-TLS to encrypt the session, and reject connection to servers that do not support it</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/notls</i></td> <td colspan="1" rowspan="1" align="left">do not do start-TLS to encrypt the session, even with servers that support it</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left"><i>/readonly</i></td> <td colspan="1" rowspan="1" align="left">request read-only mailbox open (IMAP only; ignored on NNTP, and an error with SMTP and POP3)</td> </tr> </tbody> </colgroup>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -