Class Imap

Summary

Fully Qualified Name: Zend\Mail\Storage\Imap
Extends: AbstractStorage
Implements: FolderInterface, WritableInterface

Description

Methods

Name Description Defined By
__construct() create instance with parameters Imap
__destruct() Destructor calls close() and therefore closes the resource. AbstractStorage
__get() Getter for has-properties. The standard has properties are: hasFolder, hasUniqueid, hasDelete, hasCreate, hasTop AbstractStorage
appendMessage() append a new message to mail storage Imap
close() Close resource for mail lib. Imap
copyMessage() copy an existing message Imap
count() Countable::count() AbstractStorage
countMessages() Count messages all messages in current box Imap
createFolder() create a new folder Imap
current() Iterator::current() AbstractStorage
delimiter() get IMAP delimiter Imap
getCapabilities() Get a full list of features supported by the specific mail lib and the server AbstractStorage
getCurrentFolder() get Folder instance for current folder Imap
getFolders() get root folder or given folder Imap
getMessage() Fetch a message Imap
getNumberByUniqueId() get a message number from a unique id Imap
getRawContent() Imap
getRawHeader() Imap
getSize() get a list of messages with number and size Imap
getUniqueId() get unique id for one or all messages Imap
key() Iterator::key() AbstractStorage
moveMessage() move an existing message Imap
next() Iterator::next() AbstractStorage
noop() Keep the server busy. Imap
offsetExists() ArrayAccess::offsetExists() AbstractStorage
offsetGet() ArrayAccess::offsetGet() AbstractStorage
offsetSet() ArrayAccess::offsetSet() AbstractStorage
offsetUnset() ArrayAccess::offsetUnset() AbstractStorage
removeFolder() remove a folder Imap
removeMessage() Remove a message from server. Imap
renameFolder() rename and/or move folder Imap
rewind() Iterator::rewind() AbstractStorage
seek() SeekableIterator::seek() AbstractStorage
selectFolder() select given folder Imap
setFlags() set flags for message Imap
valid() Iterator::valid() AbstractStorage

Method Details

__construct()

create instance with parameters

Supported parameters are

Parameter Name Type Description
$params array mail

Returns:

__destruct()

Destructor calls close() and therefore closes the resource.

Returns:

__get()

Getter for has-properties. The standard has properties are: hasFolder, hasUniqueid, hasDelete, hasCreate, hasTop

The valid values for the has-properties are:

Parameter Name Type Description
$var string property

Returns: bool supported or not

appendMessage()

append a new message to mail storage

Parameter Name Type Description
$message string message
$folder null|string|\Folder folder
$flags null|array set

Returns:

close()

Close resource for mail lib.

If you need to control, when the resource is closed. Otherwise the destructor would call this.

Returns:

copyMessage()

copy an existing message

Parameter Name Type Description
$id int number
$folder string|\Folder name

Returns:

count()

Countable::count()

Returns: int

countMessages()

Count messages all messages in current box

Parameter Name Type Description
$flags null

Returns: int number of messages

createFolder()

create a new folder

This method also creates parent folders if necessary. Some mail storages may restrict, which folder may be used as parent or which chars may be used in the folder name

Parameter Name Type Description
$name string global
$parentFolder string|\Folder parent

Returns:

current()

Iterator::current()

Returns: \Message current message

delimiter()

get IMAP delimiter

Returns: string|null

getCapabilities()

Get a full list of features supported by the specific mail lib and the server

Returns: array list of features as array(feature_name => true|false[|null])

getCurrentFolder()

get Folder instance for current folder

Returns: \Folder instance of current folder

getFolders()

get root folder or given folder

Parameter Name Type Description
$rootFolder string get

Returns: \Folder root or wanted folder

getMessage()

Fetch a message

Parameter Name Type Description
$id int number

Returns: \Message

getNumberByUniqueId()

get a message number from a unique id

I.e. if you have a webmailer that supports deleting messages you should use unique ids as parameter and use this method to translate it to message number right before calling removeMessage()

Parameter Name Type Description
$id string unique

Returns: int message number

getRawContent()

Parameter Name Type Description
$id
$part

Returns: void

getRawHeader()

Parameter Name Type Description
$id
$part
$topLines

Returns: void

getSize()

get a list of messages with number and size

Parameter Name Type Description
$id int number

Returns: int|array size of given message of list with all messages as [num => size]

getUniqueId()

get unique id for one or all messages

if storage does not support unique ids it's the same as the message number.

Parameter Name Type Description
$id int|null message

Returns: array|string message number for given message or all messages as array

key()

Iterator::key()

Returns: int id of current position

moveMessage()

move an existing message

NOTE: IMAP has no native move command, thus it's emulated with copy and delete

Parameter Name Type Description
$id int number
$folder string|\Folder name

Returns:

next()

Iterator::next()

Returns:

noop()

Keep the server busy.

Returns:

offsetExists()

ArrayAccess::offsetExists()

Parameter Name Type Description
$id int

Returns: bool

offsetGet()

ArrayAccess::offsetGet()

Parameter Name Type Description
$id int

Returns: \Zend\Mail\Storage\Message message object

offsetSet()

ArrayAccess::offsetSet()

Parameter Name Type Description
$id mixed
$value mixed

Returns:

offsetUnset()

ArrayAccess::offsetUnset()

Parameter Name Type Description
$id int

Returns: bool success

removeFolder()

remove a folder

Parameter Name Type Description
$name string|\Folder name

Returns:

removeMessage()

Remove a message from server.

If you're doing that from a web environment you should be careful and use a uniqueid as parameter if possible to identify the message.

Parameter Name Type Description
$id int number

Returns:

renameFolder()

rename and/or move folder

The new name has the same restrictions as in createFolder()

Parameter Name Type Description
$oldName string|\Folder name
$newName string new

Returns:

rewind()

Iterator::rewind()

Rewind always gets the new count from the storage. Thus if you use the interfaces and your scripts take long you should use reset() from time to time.

Returns:

seek()

SeekableIterator::seek()

Parameter Name Type Description
$pos int

Returns:

selectFolder()

select given folder

folder must be selectable!

Parameter Name Type Description
$globalName \Folder|string global

Returns:

setFlags()

set flags for message

NOTE: this method can't set the recent flag.

Parameter Name Type Description
$id int number
$flags array new

Returns:

valid()

Iterator::valid()

Returns: bool

Top