[PHP] Imap.
1/ Répertoire de travail.
➜ ~ mkdir IMAP ➜ ~ cd IMAP ➜ IMAP
2/ Installation des paquets ‘imap‘ pour PHP.
➜ IMAP sudo apt-get install php-net-imap php-imap
3/ Code PHP.
Ouvrir :
imap.php
Ajouter :
Mailboxes\n"; $folders = imap_listmailbox($mbox, "{mail.gandi.net:993/imap/ssl}", "*"); if ($folders == false) { echo "Appel échoué
\n"; } else { foreach ($folders as $val) { echo $val . "
\n"; } } echo "en-têtes dans INBOX
\n"; $headers = imap_headers($mbox); if ($headers == false) { echo "Appel échoué
\n"; } else { foreach ($headers as $val) { echo $val . "
\n"; } } imap_close($mbox); ?>
4/ Exécution.
➜ IMAP php ./imap.phpMailboxes
{mail.gandi.net:993/imap/ssl}Membre
{mail.gandi.net:993/imap/ssl}Projet
{mail.gandi.net:993/imap/ssl}Sent
{mail.gandi.net:993/imap/ssl}Trash
{mail.gandi.net:993/imap/ssl}INBOX
en-têtes dans INBOX
1)10-Feb-2017 Sam SonofSatan test gmail => Gandi (3119 chars)
2)10-Feb-2017 contact@espace-bidou Test Gandi => Gmail (425 chars)
3)10-Feb-2017 Sam SonofSatan gmail => gandi (3105 chars)
4)13-Feb-2017 Sammy Je viens d'avoir votre me (4042 chars)
5) 5-Apr-2017 contact@espace-bidou {Junk} Confirmation instructions (2864 chars)
U 6)10-Apr-2017 Mail Delivery System {Junk} Undelivered Mail Returned (5100 chars)
➜ IMAP
5/ Lien.
http://www.lephpfacile.com/manuel-php/function.imap-open.php
Comments are closed, but trackbacks and pingbacks are open.