category |
Zend |
package |
Zend_Mail |
subpackage |
Storage |
copyright |
Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license |
New BSD License |
inherited_from |
\Zend_Mail_Storage_Abstract |
Methods
create instance with parameters
Supported paramters are
- user username
- host hostname or ip address of IMAP server [optional, default = 'localhost']
- password password for user 'username' [optional, default = '']
- port port for IMAP server [optional, default = 110]
- ssl 'SSL' or 'TLS' for secure sockets
- folder select this folder [optional, default = 'INBOX']
__construct(array $params)
inherited_from |
\Zend_Mail_Storage_Abstract::__construct() |
Parameters
$params
array
mail reader specific parameters
Exceptions
\Zend_Mail_Storage_Exception |
|
\Zend_Mail_Protocol_Exception |
|
Create instance with parameters
__construct(array $params)
Inherited
Parameters
$params
array
mail reader specific parameters
Exceptions
\Zend_Mail_Storage_Exception |
|
Destructor calls close() and therefore closes the resource.
__destruct()
Inherited
Getter for has-properties. The standard has properties
are: hasFolder, hasUniqueid, hasDelete, hasCreate, hasTop
__get(string $var) : boolean
Inherited
The valid values for the has-properties are:
- true if a feature is supported
- false if a feature is not supported
- null is it's not yet known or it can't be know if a feature is supported
Parameters
Exceptions
\Zend_Mail_Storage_Exception |
|
Returns
boolean
supported or not
append a new message to mail storage
appendMessage(string|\Zend_Mail_Message|\Zend_Mime_Message $message, null|string|\Zend_Mail_Storage_Folder $folder = null
, null|array $flags = null
)
inherited_from |
\Zend_Mail_Storage_Writable_Interface::appendMessage() |
Parameters
$message
$folder
$flags
Close resource for mail lib. If you need to control, when the resource
is closed. Otherwise the destructor would call this.
close() : null
inherited_from |
\Zend_Mail_Storage_Abstract::close() |
Returns
null
Close resource for mail lib. If you need to control, when the resource
is closed. Otherwise the destructor would call this.
close() : null
Inherited
copy an existing message
copyMessage(integer $id, string|\Zend_Mail_Storage_Folder $folder) : null
inherited_from |
\Zend_Mail_Storage_Writable_Interface::copyMessage() |
Parameters
$id
integer
number of message
$folder
string
\Zend_Mail_Storage_Folder
name or instance of targer folder
Exceptions
\Zend_Mail_Storage_Exception |
|
Returns
null
Countable::count()
count() : integer
Inherited
Count messages all messages in current box
countMessages($flags = null
) : integer
inherited_from |
\Zend_Mail_Storage_Abstract::countMessages() |
Parameters
$flags
Exceptions
\Zend_Mail_Storage_Exception |
|
\Zend_Mail_Protocol_Exception |
|
Returns
integer
number of messages
Count messages messages in current box/folder
countMessages() : integer
Inherited
Exceptions
\Zend_Mail_Storage_Exception |
|
Returns
integer
number of messages
create a new folder
createFolder(string $name, string|\Zend_Mail_Storage_Folder $parentFolder = null
) : null
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
inherited_from |
\Zend_Mail_Storage_Writable_Interface::createFolder() |
Parameters
$name
string
global name of folder, local name if $parentFolder is set
$parentFolder
string
\Zend_Mail_Storage_Folder
parent folder for new folder, else root folder is parent
Exceptions
\Zend_Mail_Storage_Exception |
|
Returns
null
Iterator::current()
current() : \Zend_Mail_Message
Inherited
Returns
\Zend_Mail_Message
current message
Get a full list of features supported by the specific mail lib and the server
getCapabilities() : array
Inherited
Returns
array
list of features as array(featurename => true|false[|null])
get Zend_Mail_Storage_Folder instance for current folder
getCurrentFolder() : \Zend_Mail_Storage_Folder
inherited_from |
\Zend_Mail_Storage_Folder_Interface::getCurrentFolder() |
Exceptions
\Zend_Mail_Storage_Exception |
|
Returns
\Zend_Mail_Storage_Folder
instance of current folder
get root folder or given folder
getFolders(string $rootFolder = null
) : \Zend_Mail_Storage_Folder
inherited_from |
\Zend_Mail_Storage_Folder_Interface::getFolders() |
Parameters
$rootFolder
string
get folder structure for given folder, else root
Exceptions
\Zend_Mail_Storage_Exception |
|
\Zend_Mail_Protocol_Exception |
|
Returns
\Zend_Mail_Storage_Folder
root or wanted folder
Fetch a message
getMessage(integer $id) : \Zend_Mail_Message
inherited_from |
\Zend_Mail_Storage_Abstract::getMessage() |
Parameters
$id
integer
number of message
Exceptions
\Zend_Mail_Protocol_Exception |
|
Returns
\Zend_Mail_Message
Get a message with headers and body
getMessage(integer $id) : \Zend_Mail_Message
Inherited
Parameters
$id
integer
number of message
Returns
\Zend_Mail_Message
get a message number from a unique id
getNumberByUniqueId(string $id) : integer
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()
inherited_from |
\Zend_Mail_Storage_Abstract::getNumberByUniqueId() |
Parameters
Exceptions
\Zend_Mail_Storage_Exception |
|
Returns
integer
message number
get a message number from a unique id
getNumberByUniqueId(string $id) : integer
Inherited
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()
Parameters
Exceptions
\Zend_Mail_Storage_Exception |
|
Returns
integer
message number
Get raw content of message or part
getRawContent(integer $id, null|array|string $part = null
)
inherited_from |
\Zend_Mail_Storage_Abstract::getRawContent() |
Parameters
$id
$part
Get raw content of message or part
getRawContent(integer $id, null|array|string $part = null
) : string
Inherited
Parameters
$id
integer
number of message
$part
null
array
string
path to part or null for messsage content
Returns
string
raw content
get a list of messages with number and size
getSize(integer $id = 0
) : integer | array
inherited_from |
\Zend_Mail_Storage_Abstract::getSize() |
Parameters
$id
integer
number of message
Exceptions
\Zend_Mail_Protocol_Exception |
|
Returns
integer
array
size of given message of list with all messages as array(num => size)
Get a list of messages with number and size
getSize(integer $id = 0
) : integer | array
Inherited
Parameters
$id
integer
number of message
Returns
integer
array
size of given message of list with all messages as array(num => size)
get unique id for one or all messages
getUniqueId(integer|null $id = null
) : array | string
if storage does not support unique ids it's the same as the message number
inherited_from |
\Zend_Mail_Storage_Abstract::getUniqueId() |
Parameters
$id
integer
null
message number
Exceptions
\Zend_Mail_Storage_Exception |
|
Returns
array
string
message number for given message or all messages as array
get unique id for one or all messages
getUniqueId(integer|null $id = null
) : array | string
Inherited
if storage does not support unique ids it's the same as the message number
Parameters
$id
integer
null
message number
Exceptions
\Zend_Mail_Storage_Exception |
|
Returns
array
string
message number for given message or all messages as array
Iterator::key()
key() : integer
Inherited
Returns
integer
id of current position
move an existing message
moveMessage(integer $id, string|\Zend_Mail_Storage_Folder $folder) : null
NOTE: imap has no native move command, thus it's emulated with copy and delete
inherited_from |
\Zend_Mail_Storage_Writable_Interface::moveMessage() |
Parameters
$id
integer
number of message
$folder
string
\Zend_Mail_Storage_Folder
name or instance of targer folder
Exceptions
\Zend_Mail_Storage_Exception |
|
Returns
null
Iterator::next()
next() : void
Inherited
Keep the server busy.
noop() : null
inherited_from |
\Zend_Mail_Storage_Abstract::noop() |
Exceptions
\Zend_Mail_Storage_Exception |
|
Returns
null
Keep the resource alive.
noop() : null
Inherited
ArrayAccess::offsetExists()
offsetExists(integer $id) : boolean
Inherited
Parameters
$id
integer
Returns
boolean
ArrayAccess::offsetGet()
offsetGet(integer $id) : \Zend_Mail_Message
Inherited
Parameters
$id
integer
Returns
\Zend_Mail_Message
message object
ArrayAccess::offsetSet()
offsetSet(\id $id, mixed $value) : void
Inherited
Parameters
$id
\id
$value
mixed
Exceptions
\Zend_Mail_Storage_Exception |
|
ArrayAccess::offsetUnset()
offsetUnset(integer $id) : boolean
Inherited
Parameters
$id
integer
Returns
boolean
success
remove a folder
removeFolder(string|\Zend_Mail_Storage_Folder $name) : null
inherited_from |
\Zend_Mail_Storage_Writable_Interface::removeFolder() |
Parameters
$name
string
\Zend_Mail_Storage_Folder
name or instance of folder
Exceptions
\Zend_Mail_Storage_Exception |
|
Returns
null
Remove a message from server. If you're doing that from a web enviroment
you should be careful and use a uniqueid as parameter if possible to
identify the message.
removeMessage(integer $id) : null
inherited_from |
\Zend_Mail_Storage_Abstract::removeMessage() |
Parameters
$id
integer
number of message
Exceptions
\Zend_Mail_Storage_Exception |
|
Returns
null
delete a message from current box/folder
removeMessage($id) : null
Inherited
Parameters
$id
Returns
null
rename and/or move folder
renameFolder(string|\Zend_Mail_Storage_Folder $oldName, string $newName) : null
The new name has the same restrictions as in createFolder()
inherited_from |
\Zend_Mail_Storage_Writable_Interface::renameFolder() |
Parameters
$oldName
string
\Zend_Mail_Storage_Folder
name or instance of folder
$newName
string
new global name of folder
Exceptions
\Zend_Mail_Storage_Exception |
|
Returns
null
Iterator::rewind()
rewind() : void
Inherited
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.
SeekableIterator::seek()
seek(integer $pos) : void
Inherited
Parameters
$pos
integer
Exceptions
select given folder
selectFolder(\Zend_Mail_Storage_Folder|string $globalName) : null
folder must be selectable!
inherited_from |
\Zend_Mail_Storage_Folder_Interface::selectFolder() |
Parameters
$globalName
\Zend_Mail_Storage_Folder
string
global name of folder or instance for subfolder
Exceptions
\Zend_Mail_Storage_Exception |
|
\Zend_Mail_Protocol_Exception |
|
Returns
null
set flags for message
setFlags(integer $id, array $flags)
NOTE: this method can't set the recent flag.
inherited_from |
\Zend_Mail_Storage_Writable_Interface::setFlags() |
Parameters
$id
integer
number of message
$flags
array
new flags for message
Exceptions
\Zend_Mail_Storage_Exception |
|
Iterator::valid()
valid() : boolean
Inherited
Properties
name of current folder
$_currentFolder : string
class capabilities with default values
$_has : array
Default
array('uniqueid' => true, 'delete' => false, 'create' => false, 'top' => false, 'fetchPart' => true, 'flags' => false)
maximum iteration position (= message count)
$_iterationMax : null | integer
current iteration position
$_iterationPos : integer
imap flags to constants translation
$_knownFlags : array
Default
array('\Passed' => \Zend_Mail_Storage::FLAG_PASSED, '\Answered' => \Zend_Mail_Storage::FLAG_ANSWERED, '\Seen' => \Zend_Mail_Storage::FLAG_SEEN, '\Unseen' => \Zend_Mail_Storage::FLAG_UNSEEN, '\Deleted' => \Zend_Mail_Storage::FLAG_DELETED, '\Draft' => \Zend_Mail_Storage::FLAG_DRAFT, '\Flagged' => \Zend_Mail_Storage::FLAG_FLAGGED)
Static
used message class, change it in an extened class to extend the returned message class
$_messageClass : string
Default
'Zend_Mail_Message'
protocol handler
$_protocol : null | \Zend_Mail_Protocol_Imap
map flags to search criterias
$_searchFlags : array
Default
array('\Recent' => 'RECENT', '\Answered' => 'ANSWERED', '\Seen' => 'SEEN', '\Unseen' => 'UNSEEN', '\Deleted' => 'DELETED', '\Draft' => 'DRAFT', '\Flagged' => 'FLAGGED')
Static