Skip to content

wnlima2/Imap_parser.php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Imap_parser.php

IMAP mailbox parser using PHP & return Array or JSON.

  • data:

    • email:
      • hostname
      • username
      • password
    • pagination:
      • sort
      • limit
      • offset
  • result:

    • status
    • email
    • count
    • inbox:
      • id
      • subject
      • from
      • email
      • date
      • message
      • image
    • pagination
      • sort
      • limit
      • offset
        • back
        • next

Sample:

<?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);

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
            )

    )

)

About

IMAP mailbox parser using PHP & return Array or JSON.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%