Skip to content

Replacement for PHP IMAP extension. Supports XOAUTH2-authentication.

License

Notifications You must be signed in to change notification settings

freescout-helpdesk/ximap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ximap

Wrapper around Zend Mail providing same set of functions as PHP IMAP but with x-prefix (ximap_open, ximap_fetchbody, ximap_list, etc.) for easier migration from PHP IMAP extension. Supports XOAUTH2-authentication. PHP IMAP does not support and will not support OAuth-authentication, this is the reason for creating Ximap.

If PHP IMAP extension is installed and no OAuth-authentication is needed, Ximap automatically falls back to the native PHP IMAP extension functions.

Usage

You can use functions:

$imap = ximap_open("{imap.example.org}", "sample@example.com","password");

$list = ximap_list($imap, "{imap.example.org}", "*");
if (is_array($list)) {
    foreach ($list as $val) {
        echo ximap_utf7_decode($val) . "\n";
    }
} else {
    echo "imap_list failed: " . ximap_last_error() . "\n";
}

ximap_close($imap);

Or you can use Ximap\Imap class:

$ximap = Ximap\Imap("{mail.example.com:143}", "sample@example.com","password");

$list = $ximap->imap_list();
if (is_array($list)) {
    foreach ($list as $val) {
        echo $ximap->imap_utf7_decode($val) . "\n";
    }
} else {
    echo "imap_list failed: " . $ximap->imap_last_error() . "\n";
}

$ximap->imap_close($imap);

About

Replacement for PHP IMAP extension. Supports XOAUTH2-authentication.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages