IMAP mailbox parser using PHP & return Array or JSON.
-
data:
- email:
- hostname
- username
- password
- pagination:
- sort
- limit
- offset
- email:
-
result:
- status
- count
- inbox:
- id
- subject
- from
- date
- message
- image
- pagination
- sort
- limit
- offset
- back
- next
<?php// include Imap_parser class include_once('lib/Imap_parser.php');
// create Imap_parser Object $email = new Imap_parser();
// data $data = array( // email account 'email' => array( 'hostname' => '{mail.ibacor.com:143/notls}INBOX', 'username' => '[email protected]', 'password' => 'omt3l0l3t0m'
), // inbox pagination 'pagination' => array( 'sort' => 'ASC', // or DESC 'limit' => 3, 'offset' => 9 ) );// get inbox. Array $result = $email->inbox($data);
// Array print_r($result);
// JSON // echo json_encode($result);
Array ( [status] => success [email] => [email protected] [count] => 113 [inbox] => Array ( [0] => Array ( [id] => 10 [subject] => Re: [bachors/jQuery-Youtube-Channels-Playlist] [from] => anu [email] => [email protected] [date] => Thu, 24 Nov 2016 11:12:02 +0000 [message] => Hi, I'm anu on github. [image] => data:image/jpeg;base64,... )[1] => Array ( ... ) [2] => Array ( ... ) ) [pagination] => Array ( [sort] => ASC [limit] => 3 [offset] => Array ( [back] => 6 [next] => 12 ) )
)