$imapPath
$imapPath : string
Путь к IMAP
Класс для работы с почтовым ящиком
__construct(string $imapPath, string $login, string $password, string $attachmentsDir = null, string $serverEncoding = 'UTF-8')
Конструктор
| string | $imapPath | путь к IMAP |
| string | $login | логин |
| string | $password | пароль |
| string | $attachmentsDir | директория для хранения вложений |
| string | $serverEncoding | кодировка сервера |
checkMailbox() : \Colibri\IO\Mail\Mailbox\stdClass
Get information about the current mailbox.
Returns the information in an object with following properties: Date - current system time formatted according to RFC2822 Driver - protocol used to access this mailbox: POP3, IMAP, NNTP Mailbox - the mailbox name Nmsgs - number of mails in the mailbox Recent - number of recent mails in the mailbox
statusMailbox() : \Colibri\IO\Mail\Mailbox\stdClass
Gets status information about the given mailbox.
This function returns an object containing status information. The object has the following properties: messages, recent, unseen, uidnext, and uidvalidity.
if the box doesn't exist
searchMailbox(string $criteria = 'ALL') : array
This function uses imap_search() to perform a search on the mailbox currently opened in the given IMAP stream.
For example, to match all unanswered mails sent by Mom, you'd use: "UNANSWERED FROM mom".
| string | $criteria | See http://php.net/imap_search for a complete list of available criteria |
mailsIds (or empty array)
setFlag(array $mailsIds, string $flag) : boolean
Causes a store to add the specified flag to the flags set for the mails in the specified sequence.
| array | $mailsIds | |
| string | $flag | which you can set are \Seen, \Answered, \Flagged, \Deleted, and \Draft as defined by RFC2060. |
clearFlag(array $mailsIds, string $flag) : boolean
Cause a store to delete the specified flag to the flags set for the mails in the specified sequence.
| array | $mailsIds | |
| string | $flag | which you can set are \Seen, \Answered, \Flagged, \Deleted, and \Draft as defined by RFC2060. |
getMailsInfo(array $mailsIds) : array
Fetch mail headers for listed mails ids
Returns an array of objects describing one mail header each. The object will only define a property if it exists. The possible properties are: subject - the mails subject from - who sent it to - recipient date - when was it sent message_id - Mail-ID references - is a reference to this mail id in_reply_to - is a reply to this mail id size - size in bytes uid - UID the mail has in the mailbox msgno - mail sequence number in the mailbox recent - this mail is flagged as recent flagged - this mail is flagged answered - this mail is flagged as answered deleted - this mail is flagged for deletion seen - this mail is flagged as already read draft - this mail is flagged as being a draft
| array | $mailsIds |
getMailboxInfo() : object
Get information about the current mailbox.
Returns an object with following properties: Date - last change (current datetime) Driver - driver Mailbox - name of the mailbox Nmsgs - number of messages Recent - number of recent messages Unread - number of unread messages Deleted - number of deleted messages Size - mailbox size
Object with info | FALSE on failure
sortMails(integer $criteria = SORTARRIVAL, boolean $reverse = true) : array
Gets mails ids sorted by some criteria
Criteria can be one (and only one) of the following constants: SORTDATE - mail Date SORTARRIVAL - arrival date (default) SORTFROM - mailbox in first From address SORTSUBJECT - mail subject SORTTO - mailbox in first To address SORTCC - mailbox in first cc address SORTSIZE - size of mail in octets
| integer | $criteria | |
| boolean | $reverse |
Mails ids
getMail( $mailId, boolean $markAsSeen = true) : \Colibri\IO\Mail\Mailbox\Mail
Get mail data
| $mailId | ||
| boolean | $markAsSeen |
initMailPart(\Colibri\IO\Mail\Mailbox\Mail $mail, mixed $partStructure, mixed $partNum, boolean $markAsSeen = true) : void
Создает пакет IMAP
| \Colibri\IO\Mail\Mailbox\Mail | ||
| mixed | $partStructure | |
| mixed | $partNum | |
| boolean | $markAsSeen |
convertStringEncoding(string $string, string $fromEncoding, string $toEncoding) : string
Converts a string from one encoding to another.
| string | $string | |
| string | $fromEncoding | |
| string | $toEncoding |
Converted string if conversion was successful, or the original string if not