$folder = "Название папки на кирилице" ;
imap_open("{imap.example.com}/".$folder, $login, $password);
Notice: Unknown: [CLIENTBUG] SELECT No such folder. sc=xQG36O15YuQ0_200927_imap-production-586 (errflg=2) in Unknown on line 0
<?php
$folder = "Название папки на кириллице";
$encodedFolder = mb_convert_encoding($folder, "UTF7-IMAP", "UTF-8");
$imapStream = imap_open("{imap.example.com}" . $encodedFolder, $login, $password);
if ($imapStream === false) {
echo "Ошибка: " . imap_last_error();
exit;
}
$encodedFolder = imap_utf7_encode($folder);