API Documentation

Mail/Storage/Imap.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Mail
subpackage
Storage
version
$Id: Imap.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Mail_Storage_Imap

Description

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.

Zend_Mail_Storage_Imap

Extends from
Zend_Mail_Storage_Abstract
Implements
Zend_Mail_Storage_Folder_Interface
Zend_Mail_Storage_Writable_Interface
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Mail
subpackage
Storage
Properties
$_protocol
$_currentFolder
$_knownFlags
$_searchFlags
Methods
countMessages
getSize
getMessage
getRawHeader
getRawContent
__construct
close
noop
removeMessage
getUniqueId
getNumberByUniqueId
getFolders
selectFolder
getCurrentFolder
createFolder
removeFolder
renameFolder
appendMessage
copyMessage
moveMessage
setFlags

Description

Properties

$_currentFolder

string $_currentFolder = ''

name of current folder

Details

$_currentFolder
string
visibility
protected
default
final
false
static
false

$_knownFlags

array $_knownFlags = 'array'

imap flags to constants translation

Details

$_knownFlags
array
visibility
protected
default
array
final
false
static
true

$_protocol

null|Zend_Mail_Protocol_Imap $_protocol = ''

protocol handler

Details

$_protocol
null|Zend_Mail_Protocol_Imap
visibility
protected
default
final
false
static
false

$_searchFlags

array $_searchFlags = 'array'

map flags to search criterias

Details

$_searchFlags
array
visibility
protected
default
array
final
false
static
true

Methods

__construct

__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']

Arguments
$params
array
mail reader specific parameters
Details
visibility
public
final
false
static
false
throws
throws

appendMessage

appendMessage( string $message, null|string|Zend_Mail_Storage_Folder $folder = null, null|array $flags = null ) :

append a new message to mail storage

Arguments
$message
string
message as string or instance of message class
$folder
nullstringZend_Mail_Storage_Folder
folder for new message, else current folder is taken
$flags
nullarray
set flags for new message, else a default set is used
Details
visibility
public
final
false
static
false
throws

close

close( ) : null

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

Output
null
Details
visibility
public
final
false
static
false

copyMessage

copyMessage( int $id, string|Zend_Mail_Storage_Folder $folder ) : null

copy an existing message

Arguments
$id
int
number of message
$folder
stringZend_Mail_Storage_Folder
name or instance of targer folder
Output
null
Details
visibility
public
final
false
static
false
throws

countMessages

countMessages(  $flags = null ) : int

Count messages all messages in current box

Arguments
$flags
Output
int
number of messages
Details
visibility
public
final
false
static
false
throws
throws

createFolder

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

Arguments
$name
string
global name of folder, local name if $parentFolder is set
$parentFolder
stringZend_Mail_Storage_Folder
parent folder for new folder, else root folder is parent
Output
null
Details
visibility
public
final
false
static
false
throws

getCurrentFolder

getCurrentFolder( ) : Zend_Mail_Storage_Folder

get Zend_Mail_Storage_Folder instance for current folder

Output
Zend_Mail_Storage_Folder
instance of current folder
Details
visibility
public
final
false
static
false
throws

getFolders

getFolders( string $rootFolder = null ) : Zend_Mail_Storage_Folder

get root folder or given folder

Arguments
$rootFolder
string
get folder structure for given folder, else root
Output
Zend_Mail_Storage_Folder
root or wanted folder
Details
visibility
public
final
false
static
false
throws
throws

getMessage

getMessage( int $id ) : Zend_Mail_Message

Fetch a message

Arguments
$id
int
number of message
Details
visibility
public
final
false
static
false
throws

getNumberByUniqueId

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()

Arguments
$id
string
unique id
Output
int
message number
Details
visibility
public
final
false
static
false
throws

getRawContent

getRawContent(  $id,  $part = null ) :
Arguments
$id
$part
Details
visibility
public
final
false
static
false

getRawHeader

getRawHeader(  $id,  $part = null,  $topLines = 0 ) :
Arguments
$id
$part
$topLines
Details
visibility
public
final
false
static
false

getSize

getSize( int $id = 0 ) : int|array

get a list of messages with number and size

Arguments
$id
int
number of message
Output
int|array
size of given message of list with all messages as array(num => size)
Details
visibility
public
final
false
static
false
throws

getUniqueId

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

Arguments
$id
intnull
message number
Output
array|string
message number for given message or all messages as array
Details
visibility
public
final
false
static
false
throws

moveMessage

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

Arguments
$id
int
number of message
$folder
stringZend_Mail_Storage_Folder
name or instance of targer folder
Output
null
Details
visibility
public
final
false
static
false
throws

noop

noop( ) : null

Keep the server busy.

Output
null
Details
visibility
public
final
false
static
false
throws

removeFolder

removeFolder( string|Zend_Mail_Storage_Folder $name ) : null

remove a folder

Arguments
$name
stringZend_Mail_Storage_Folder
name or instance of folder
Output
null
Details
visibility
public
final
false
static
false
throws

removeMessage

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.

Arguments
$id
int
number of message
Output
null
Details
visibility
public
final
false
static
false
throws

renameFolder

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()

Arguments
$oldName
stringZend_Mail_Storage_Folder
name or instance of folder
$newName
string
new global name of folder
Output
null
Details
visibility
public
final
false
static
false
throws

selectFolder

selectFolder( Zend_Mail_Storage_Folder|string $globalName ) : null

select given folder

folder must be selectable!

Arguments
$globalName
Zend_Mail_Storage_Folderstring
global name of folder or instance for subfolder
Output
null
Details
visibility
public
final
false
static
false
throws
throws

setFlags

setFlags( int $id, array $flags ) :

set flags for message

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

Arguments
$id
int
number of message
$flags
array
new flags for message
Details
visibility
public
final
false
static
false
throws
Documentation was generated by DocBlox.