Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
string $_currentFolder = ''
name of current folder
array $_knownFlags = 'array'
imap flags to constants translation
null|Zend_Mail_Protocol_Imap $_protocol = ''
protocol handler
array $_searchFlags = 'array'
map flags to search criterias
__construct(
array $params
)
:
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']
appendMessage(
string $message, null|string|Zend_Mail_Storage_Folder $folder
=
null, null|array $flags
=
null
)
:
append a new message to mail storage
close(
)
:
null
Close resource for mail lib. If you need to control, when the resource is closed. Otherwise the destructor would call this.
copyMessage(
int $id, string|Zend_Mail_Storage_Folder $folder
)
:
null
copy an existing message
countMessages(
$flags
=
null
)
:
int
Count messages all messages in current box
createFolder(
string $name, string|Zend_Mail_Storage_Folder $parentFolder
=
null
)
:
null
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
getCurrentFolder(
)
:
Zend_Mail_Storage_Folder
get Zend_Mail_Storage_Folder instance for current folder
getFolders(
string $rootFolder
=
null
)
:
Zend_Mail_Storage_Folder
get root folder or given folder
getMessage(
int $id
)
:
Zend_Mail_Message
Fetch a message
getNumberByUniqueId(
string $id
)
:
int
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()
getRawContent(
$id, $part
=
null
)
:
getRawHeader(
$id, $part
=
null, $topLines
=
0
)
:
getSize(
int $id
=
0
)
:
int|array
get a list of messages with number and size
getUniqueId(
int|null $id
=
null
)
:
array|string
get unique id for one or all messages
if storage does not support unique ids it's the same as the message number
moveMessage(
int $id, string|Zend_Mail_Storage_Folder $folder
)
:
null
move an existing message
NOTE: imap has no native move command, thus it's emulated with copy and delete
noop(
)
:
null
Keep the server busy.
removeFolder(
string|Zend_Mail_Storage_Folder $name
)
:
null
remove a folder
removeMessage(
int $id
)
:
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.
renameFolder(
string|Zend_Mail_Storage_Folder $oldName, string $newName
)
:
null
rename and/or move folder
The new name has the same restrictions as in createFolder()
selectFolder(
Zend_Mail_Storage_Folder|string $globalName
)
:
null
select given folder
folder must be selectable!
setFlags(
int $id, array $flags
)
:
set flags for message
NOTE: this method can't set the recent flag.