\SSilence\ImapClientImapConnect

Class ImapConnect. Connect with imap servers.

Summary

Methods
Properties
Constants
connect()
setMailbox()
getMailbox()
getResponseMailbox()
getImap()
getFlags()
prepareMailbox()
prepareFlags()
$imap
$mailbox
$flags
SERVICE_IMAP
SERVICE_POP3
SERVICE_NNTP
ENCRYPT_SSL
ENCRYPT_TLS
ENCRYPT_NOTLS
VALIDATE_CERT
NOVALIDATE_CERT
DEBUG
SECURE
NORSH
READONLY
ANONYMOUS
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

SERVICE_IMAP

SERVICE_IMAP

SERVICE_POP3

SERVICE_POP3

SERVICE_NNTP

SERVICE_NNTP

ENCRYPT_SSL

ENCRYPT_SSL

ENCRYPT_TLS

ENCRYPT_TLS

ENCRYPT_NOTLS

ENCRYPT_NOTLS

VALIDATE_CERT

VALIDATE_CERT

NOVALIDATE_CERT

NOVALIDATE_CERT

DEBUG

DEBUG

SECURE

SECURE

NORSH

NORSH

READONLY

READONLY

ANONYMOUS

ANONYMOUS

Properties

$imap

$imap : resource

Current imap stream

Type

resource

$mailbox

$mailbox : string

Current mailbox

Type

string

$flags

$flags : string

Current flags connecting

Type

string

Methods

connect()

connect(string|array  $mailbox, string  $username = null, string  $password = null, integer  $options, integer  $n_retries, array  $params = array()) : void

The connection to the server

Description of the method imap_open() to look at the link below http://php.net/manual/ru/function.imap-open.php

Use as follows:

connect( null, 'username', 'password' ) or connect([ 'username' => 'Name', 'password' => 'Pass' ])

Parameters

string|array $mailbox
string $username
string $password
integer $options
integer $n_retries
array $params

Throws

\SSilence\ImapClient\ImapClientException

setMailbox()

setMailbox(string  $mailbox) : void

Set string mailbox

Parameters

string $mailbox

getMailbox()

getMailbox() : object

Get string mailbox

Returns

object

getResponseMailbox()

getResponseMailbox() : string

Get string response mailbox

Returns

string

getImap()

getImap() : resource

Get the imap resource

Returns

resource

getFlags()

getFlags() : string

Get the flag string

Returns

string

prepareMailbox()

prepareMailbox(string|array  $remote_system_name = null, string  $port = null, string  $flags = null, string  $mailbox_name = null) : void

Prepare Mailbox string

Sets $this->mailbox to this type of {server.imap:431/imap/ssl/novalidate-cert}INBOX

Use as follows:

prepareMailbox( null, $port = 431, null) or prepareMailbox([ 'port' => 431 ])

Parameters

string|array $remote_system_name
string $port
string $flags

can use prepareFlags() method but not necessarily

string $mailbox_name

Throws

\SSilence\ImapClient\ImapClientException

prepareFlags()

prepareFlags(string|array  $service = null, string  $encrypt = null, string  $validateCertificates = null, string  $secure = null, string  $norsh = null, string  $readonly = null, string  $anonymous = null, string  $debug = null) : string|null

Prepare Flags

http://php.net/manual/ru/function.imap-open.php Section - mailbox - Optional flags for names

Use as follows:

prepareFlags( null, null, null, ImapConnect::VALIDATE_CERT, null) or prepareFlags([ 'validateCertificates' => ImapConnect::VALIDATE_CERT ])

Parameters

string|array $service

use appropriate constant like ImapConnect::SERVICE_IMAP

string $encrypt

use appropriate constant

string $validateCertificates

use appropriate constant

string $secure

use appropriate constant

string $norsh

use appropriate constant

string $readonly

use appropriate constant

string $anonymous

use appropriate constant

string $debug

use appropriate constant

Returns

string|null