dev-master
9999999-dev http://github.com/vanzhiganov/imapPHP Wrapper class for frequently used php-imap functions.
MIT
The Requires
- php >=5.3.0
imap
PHP Wrapper class for frequently used php-imap functions.
PHP Wrapper class for frequently used php-imap functions., (*1)
Connect to IMAP server, (*2)
$imap_server = 'imap.yandex.ru'; $imap_user = 'chupakabra48'; $imap_password = 'MySuperP@ssw0rd'; $imap_port = 993; $imap_ssl = true; $imap_folder = "INBOX"; $t = new Imap($imap_server, $imap_user, $imap_password, $imap_port, $imap_ssl, $imap_folder);
Returns an Associative Array containing the number of recent, unread, and total messages, (*3)
$t->getInboxInformation()
, (*4)
Returns an Associative Array containing the subject of every email along with the Message Id of each individual email., (*5)
$t->getMessageIds());
, (*6)
Given a new $host, $user, $pass, $port, $ssl, $folder inputs, this function will disconnect from the old connection and open a new connection to a specified server., (*7)
For the sake of the example, I am using the same information., (*8)
$t->changeLoginInfo($host, $user, $pass, $port, $ssl, $folder);
, (*9)
Returns an Associative Array containing detailed information about a specific Message Id., (*10)
$t->getDetailedMessageInfo(2));
, (*11)
Parses a given Email address and returns an Array containing the mailbox, host, and name of the given email address., (*12)
$a = $t->getDetailedMessageInfo(2); $t->parseAddresses($a["reply"]));
Generate an email address to comply with RFC822 specifications., (*13)
$u = "testusername"; $h = "samplehost.com"; $n = "TestFirst TestLastName"; echo $t->createAddress($u, $h, $n);
Deletes a message matching the given Message Id., (*14)
$t->deleteMessage(2);
, (*15)
Returns an Array containing structural information about a given Message Id., (*16)
@see imap_fetchstructure (http://www.php.net/manual/en/function.imap-fetchstructure.php), (*17)
print_r($t->getStructure(2));
, (*18)
Returns the body type of a given Message Id., (*19)
echo $t->getBodyType(2);
, (*20)
Returns the encoding type of a given Message Id., (*21)
echo $t->getEncodingType(2);
, (*22)
Given an encoded Base64 message, returns the decoded text., (*23)
Encoded string reads: "Testing One Two Three", (*24)
echo $t->decodeBase64("VGVzdGluZyBPbmUgVHdvIFRocmVl");
, (*25)
Given a new folder, will disconnect and reconnect to the specified folder name., (*26)
$t->changeFolder("NEW_FOLDER_NAME");
, (*27)
Disconnects an active imap connection, (*28)
$t->disconnect();
, (*29)
PHP Wrapper class for frequently used php-imap functions.
MIT
imap