Mailbox update

This commit is contained in:
Torsten Schulz
2023-06-16 14:36:44 +02:00
parent 4d302af6c7
commit 6c5e94ec12

View File

@@ -21,10 +21,10 @@ class Emailinbox extends Renderer {
echo "IMAP connection failed: " . implode(",", $ex->getErrors('all'));
die();
}
$headers = $this->mbox->getMailsInfo($mailsIds);
if (!$headers) {
if (!$mailsIds) {
return [];
}
$headers = $this->mbox->getMailsInfo($mailsIds);
foreach ($headers as $header) {
try {
$date = \DateTime::createFromFormat('D, d M Y H:i:s O', str_replace([' (CET)', ' (CEST)', ' (UTC)'], '' , $header->date));