1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/z-push_ynh.git synced 2024-09-03 18:05:58 +02:00
z-push_ynh/sources/testing/testing-imap_list_155.php

18 lines
No EOL
480 B
PHP

<?php
// $server = "{imap.example.org:993/ssl/novalidate-cert}";
// $username = "username";
// $password = "password";
$mbox = imap_open($server, $username, $password, OP_HALFOPEN) or die("unable to connect: " . imap_last_error());
$list = imap_getmailboxes($mbox, $server, "*");
if (is_array($list)) {
foreach ($list as $val) {
echo imap_utf7_decode($val->name) . "\n";
}
} else {
echo "imap_list failed: " . imap_last_error() . "\n";
}
imap_close($mbox);