Properties

$host

$host : string

Mail client host

Type

string

$port

$port : integer

Mail client port

Type

integer

$service

$service : string

Mail client service (pop, imap, nntp, etc.)

Type

string

$username

$username : string

Username

Type

string

$password

$password : string

Password

Type

string

$folder

$folder : string

Current folder

Type

string

$connectionString

$connectionString : string

Mailbox connection string

Type

string

$connection

$connection : resource

Mailbox connection resource

Type

resource

Methods

__construct()

__construct(string  $host, integer  $port, string  $service = 'imap') 

Constructor

Instantiate the IMAP mail client object

Parameters

string $host
integer $port
string $service

getHost()

getHost() : string

Get mail client host

Returns

string

getPort()

getPort() : integer

Get mail client port

Returns

integer

getService()

getService() : string

Get mail client service

Returns

string

getUsername()

getUsername() : string

Get username

Returns

string

getPassword()

getPassword() : string

Get password

Returns

string

getFolder()

getFolder() : string

Get folder

Returns

string

setService()

setService(string  $service) : \Pop\Mail\Client\AbstractClient

Set mail client service

Parameters

string $service

Returns

\Pop\Mail\Client\AbstractClient

setUsername()

setUsername(string  $username) : \Pop\Mail\Client\AbstractClient

Set username

Parameters

string $username

Returns

\Pop\Mail\Client\AbstractClient

setPassword()

setPassword(string  $password) : \Pop\Mail\Client\AbstractClient

Set password

Parameters

string $password

Returns

\Pop\Mail\Client\AbstractClient

open()

open(string  $flags = null, integer  $options = null, integer  $retries = null, array  $params = null) : \Pop\Mail\Client\Imap

Open mailbox connection

Parameters

string $flags
integer $options
integer $retries
array $params

Returns

\Pop\Mail\Client\Imap

isOpen()

isOpen() : boolean

Determine if the mailbox connection has been opened

Returns

boolean

connection()

connection() : resource

Get mailbox connection

Returns

resource

getConnectionString()

getConnectionString() : string

Get mailbox connection string

Returns

string

listMailboxes()

listMailboxes(string  $pattern = '*') : array

List mailboxes

Parameters

string $pattern

Returns

array

getStatus()

getStatus() : \stdClass

Get mailbox status

Returns

\stdClass

getNumberOfMessages()

getNumberOfMessages() : integer

Get total number of messages

Returns

integer

getNumberOfReadMessages()

getNumberOfReadMessages() : integer

Get total number of read messages

Returns

integer

getNumberOfUnreadMessages()

getNumberOfUnreadMessages() : integer

Get total number of unread messages

Returns

integer

getOverview()

getOverview(mixed  $ids, integer  $options = FT_UID) : array

Get message overviews

Parameters

mixed $ids
integer $options

Returns

array

getMessageIds()

getMessageIds(string  $criteria = 'ALL', integer  $options = SE_UID, string  $charset = null) : array

Get message IDs from a mailbox

Parameters

string $criteria
integer $options
string $charset

Returns

array

getMessageIdsBy()

getMessageIdsBy(integer  $criteria = SORTDATE, boolean  $reverse = true, integer  $options = SE_UID, string  $search = 'ALL', string  $charset = null) : array

Get message IDs from a mailbox by a sort criteria

Parameters

integer $criteria
boolean $reverse
integer $options
string $search
string $charset

Returns

array

getMessageHeaders()

getMessageHeaders(string  $criteria = 'ALL', integer  $options = SE_UID, string  $charset = null) : array

Get message headers from a mailbox

Parameters

string $criteria
integer $options
string $charset

Returns

array

getMessageHeadersBy()

getMessageHeadersBy(integer  $criteria = SORTDATE, boolean  $reverse = true, integer  $options = SE_UID, string  $search = 'ALL', string  $charset = null) : array

Get message headers from a mailbox

Parameters

integer $criteria
boolean $reverse
integer $options
string $search
string $charset

Returns

array

getMessageHeadersById()

getMessageHeadersById(integer  $id) : \stdClass

Get message headers by message ID

Parameters

integer $id

Returns

\stdClass

getMessageStructure()

getMessageStructure(integer  $id) : \stdClass

Get message structure by message ID

Parameters

integer $id

Returns

\stdClass

getMessageBoundary()

getMessageBoundary(integer  $id) : string

Get message boundary by message ID

Parameters

integer $id

Returns

string

getMessageBody()

getMessageBody(integer  $id) : string

Get message body by message ID

Parameters

integer $id

Returns

string

getMessageParts()

getMessageParts(integer  $id) : array

Get message parts by message ID

Parameters

integer $id

Returns

array

copyMessage()

copyMessage(mixed  $ids, string  $to, integer  $options = CP_UID) : \Pop\Mail\Client\Imap

Copy messages to another mailbox

Parameters

mixed $ids
string $to
integer $options

Returns

\Pop\Mail\Client\Imap

moveMessage()

moveMessage(mixed  $ids, string  $to, integer  $options = CP_UID) : \Pop\Mail\Client\Imap

Move messages to another mailbox

Parameters

mixed $ids
string $to
integer $options

Returns

\Pop\Mail\Client\Imap

markAsRead()

markAsRead(mixed  $ids, integer  $options = ST_UID) : \Pop\Mail\Client\Imap

Mark a message or messages as read

Parameters

mixed $ids
integer $options

Returns

\Pop\Mail\Client\Imap

markAsUnread()

markAsUnread(mixed  $ids, integer  $options = ST_UID) : \Pop\Mail\Client\Imap

Mark a message or messages as unread

Parameters

mixed $ids
integer $options

Returns

\Pop\Mail\Client\Imap

setMessageFlags()

setMessageFlags(mixed  $ids, string  $flags, integer  $options = ST_UID) : \Pop\Mail\Client\Imap

Mark a message or messages as read

Parameters

mixed $ids
string $flags
integer $options

Returns

\Pop\Mail\Client\Imap

clearMessageFlags()

clearMessageFlags(mixed  $ids, string  $flags, integer  $options = ST_UID) : \Pop\Mail\Client\Imap

Mark a message or messages as unread

Parameters

mixed $ids
string $flags
integer $options

Returns

\Pop\Mail\Client\Imap

deleteMessage()

deleteMessage(integer  $id, integer  $options = FT_UID) : \Pop\Mail\Client\Imap

Delete message

Parameters

integer $id
integer $options

Returns

\Pop\Mail\Client\Imap

createMailbox()

createMailbox(string  $new) : \Pop\Mail\Client\Imap

Create mailbox

Parameters

string $new

Returns

\Pop\Mail\Client\Imap

renameMailbox()

renameMailbox(string  $new, string  $old = null) : \Pop\Mail\Client\Imap

Rename mailbox

Parameters

string $new
string $old

Returns

\Pop\Mail\Client\Imap

deleteMailbox()

deleteMailbox(string  $mailbox = null) : \Pop\Mail\Client\Imap

Delete mailbox

Parameters

string $mailbox

Throws

\Pop\Mail\Client\Exception

Returns

\Pop\Mail\Client\Imap

close()

close() : void

Close the mailbox connection resource