List all directories:
The code is as follows |
Copy Code |
$host = ' {Imap.mail.yahoo.com:993/ssl} '; $user = ' user@yahoo.com '; $pass = ' password '; $inbox = Imap_open ($host, $user, $pass); $mailboxes = Imap_list ($inbox, $host, ' * '); $mailboxes = Str_replace ($host, ', $mailboxes); Print_r ($mailboxes); Results: Array ( [0] => Bulk Mail [1] => Draft [2] => Inbox [3] => Sent [4] => Trash ) Reopen the specified directory: Imap_reopen ($inbox, $host. ' Bulk Mail '); $emails = Imap_search ($inbox, ' all '); Print_r ($emails); |
Windows installation IMAP
Note In Windows we need to open an IMAP template in PHP.ini, find the Php_imap.dll extension in PHP and open it, and if you look at extensions there is no php_imap.dll need to replicate a past.
Installing IMAP in Linux
The last complete compilation of IMAP module parameters is as follows:
The code is as follows |
Copy Code |
./configure--with-php-config=/usr/local/webserver/php/bin/php-config--with-kerberos=/usr--with-imap-ssl=/usr Make Make install |