imap_open
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.
Список параметров
A mailbox name consists of a server and a mailbox path on this server. The special name INBOX 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 imap_utf7_encode() .
The server part, which is enclosed in », consists of the servers name or ip address, an optional port (prefixed by ‘:’), and an optional protocol specification (prefixed by ‘/’).
The server part is mandatory in all mailbox parameters.
- remote_system_name — Internet domain name or bracketed IP address of server.
- port — optional TCP port number, default is the default port for that service
- flags — optional flags, see following table.
- mailbox_name — remote mailbox name, default is INBOX
Flag | Description |
---|---|
/service=service | mailbox access service, default is «imap» |
/user=user | remote user name for login on the server |
/authuser=user | remote authentication user; if specified this is the user name whose password is used (e.g. administrator) |
/anonymous | remote access as anonymous user |
/debug | record protocol telemetry in application’s debug log |
/secure | do not transmit a plaintext password over the network |
/imap, /imap2, /imap2bis, /imap4, /imap4rev1 | equivalent to /service=imap |
/pop3 | equivalent to /service=pop3 |
/nntp | equivalent to /service=nntp |
/norsh | do not use rsh or ssh to establish a preauthenticated IMAP session |
/ssl | use the Secure Socket Layer to encrypt the session |
/validate-cert | validate certificates from TLS/SSL server (this is the default behavior) |
/novalidate-cert | do not validate certificates from TLS/SSL server, needed if server uses self-signed certificates |
/tls | force use of start-TLS to encrypt the session, and reject connection to servers that do not support it |
/notls | do not do start-TLS to encrypt the session, even with servers that support it |
/readonly | request read-only mailbox open (IMAP only; ignored on NNTP, and an error with SMTP and POP3) |
The password associated with the username
- OP_READONLY — Open mailbox read-only
- OP_ANONYMOUS — Don’t use or update a .newsrc for news (NNTP only)
- OP_HALFOPEN — For IMAP and NNTP names, open a connection but don’t open a mailbox.
- CL_EXPUNGE — Expunge mailbox automatically upon mailbox close (see also imap_delete() and imap_expunge() )
- OP_DEBUG — Debug protocol negotiations
- OP_SHORTCACHE — Short (elt-only) caching
- OP_SILENT — Don’t pass up events (internal use)
- OP_PROTOTYPE — Return driver prototype
- OP_SECURE — Don’t do non-secure authentication
Number of maximum connect attempts
Возвращаемые значения
Returns an IMAP stream on success or FALSE on error.
imap_open
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.
Parameters
A mailbox name consists of a server and a mailbox path on this server. The special name INBOX stands for the current users personal mailbox. Mailbox names that contain international characters besides those in the printable ASCII space have to be encoded with imap_utf7_encode() .
Passing untrusted data to this parameter is insecure, unless imap.enable_insecure_rsh is disabled.
The server part, which is enclosed in », consists of the servers name or ip address, an optional port (prefixed by ‘:’), and an optional protocol specification (prefixed by ‘/’).
The server part is mandatory in all mailbox parameters.
- remote_system_name — Internet domain name or bracketed IP address of server.
- port — optional TCP port number, default is the default port for that service
- flags — optional flags, see following table.
- mailbox_name — remote mailbox name, default is INBOX
Flag | Description |
---|---|
/service= service | mailbox access service, default is «imap» |
/user= user | remote user name for login on the server |
/authuser= user | remote authentication user; if specified this is the user name whose password is used (e.g. administrator) |
/anonymous | remote access as anonymous user |
/debug | record protocol telemetry in application’s debug log |
/secure | do not transmit a plaintext password over the network |
/imap , /imap2 , /imap2bis , /imap4 , /imap4rev1 | equivalent to /service=imap |
/pop3 | equivalent to /service=pop3 |
/nntp | equivalent to /service=nntp |
/norsh | do not use rsh or ssh to establish a preauthenticated IMAP session |
/ssl | use the Secure Socket Layer to encrypt the session |
/validate-cert | validate certificates from TLS/SSL server (this is the default behavior) |
/novalidate-cert | do not validate certificates from TLS/SSL server, needed if server uses self-signed certificates |
/tls | force use of start-TLS to encrypt the session, and reject connection to servers that do not support it |
/notls | do not do start-TLS to encrypt the session, even with servers that support it |
/readonly | request read-only mailbox open (IMAP only; ignored on NNTP, and an error with SMTP and POP3) |
The password associated with the user
- OP_READONLY — Open mailbox read-only
- OP_ANONYMOUS — Don’t use or update a .newsrc for news (NNTP only)
- OP_HALFOPEN — For IMAP and NNTP names, open a connection but don’t open a mailbox.
- CL_EXPUNGE — Expunge mailbox automatically upon mailbox close (see also imap_delete() and imap_expunge() )
- OP_DEBUG — Debug protocol negotiations
- OP_SHORTCACHE — Short ( elt -only) caching
- OP_SILENT — Don’t pass up events (internal use)
- OP_PROTOTYPE — Return driver prototype
- OP_SECURE — Don’t do non-secure authentication
Number of maximum connect attempts
Return Values
Returns an IMAP\Connection instance on success, or false on failure.
imap_open
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.
Parameters
A mailbox name consists of a server and a mailbox path on this server. The special name INBOX stands for the current users personal mailbox. Mailbox names that contain international characters besides those in the printable ASCII space have to be encoded with imap_utf7_encode() .
Passing untrusted data to this parameter is insecure, unless imap.enable_insecure_rsh is disabled.
The server part, which is enclosed in », consists of the servers name or ip address, an optional port (prefixed by ‘:’), and an optional protocol specification (prefixed by ‘/’).
The server part is mandatory in all mailbox parameters.
- remote_system_name — Internet domain name or bracketed IP address of server.
- port — optional TCP port number, default is the default port for that service
- flags — optional flags, see following table.
- mailbox_name — remote mailbox name, default is INBOX
Flag | Description |
---|---|
/service= service | mailbox access service, default is «imap» |
/user= user | remote user name for login on the server |
/authuser= user | remote authentication user; if specified this is the user name whose password is used (e.g. administrator) |
/anonymous | remote access as anonymous user |
/debug | record protocol telemetry in application’s debug log |
/secure | do not transmit a plaintext password over the network |
/imap , /imap2 , /imap2bis , /imap4 , /imap4rev1 | equivalent to /service=imap |
/pop3 | equivalent to /service=pop3 |
/nntp | equivalent to /service=nntp |
/norsh | do not use rsh or ssh to establish a preauthenticated IMAP session |
/ssl | use the Secure Socket Layer to encrypt the session |
/validate-cert | validate certificates from TLS/SSL server (this is the default behavior) |
/novalidate-cert | do not validate certificates from TLS/SSL server, needed if server uses self-signed certificates |
/tls | force use of start-TLS to encrypt the session, and reject connection to servers that do not support it |
/notls | do not do start-TLS to encrypt the session, even with servers that support it |
/readonly | request read-only mailbox open (IMAP only; ignored on NNTP, and an error with SMTP and POP3) |
user
The password associated with the user
The flags are a bit mask with one or more of the following:
- OP_READONLY — Open mailbox read-only
- OP_ANONYMOUS — Don’t use or update a .newsrc for news (NNTP only)
- OP_HALFOPEN — For IMAP and NNTP names, open a connection but don’t open a mailbox.
- CL_EXPUNGE — Expunge mailbox automatically upon mailbox close (see also imap_delete() and imap_expunge() )
- OP_DEBUG — Debug protocol negotiations
- OP_SHORTCACHE — Short ( elt -only) caching
- OP_SILENT — Don’t pass up events (internal use)
- OP_PROTOTYPE — Return driver prototype
- OP_SECURE — Don’t do non-secure authentication
Number of maximum connect attempts
Connection parameters, the following (string) keys maybe used to set one or more connection parameters:
Return Values
Returns an IMAP\Connection instance on success, or false on failure.