mirror of
https://github.com/itflow-org/itflow
synced 2026-03-03 12:24:51 +00:00
Set Charset to UTF-8 to avoid encoding issues on some mail servers
This commit is contained in:
@@ -320,7 +320,8 @@ $client = $clientManager->make([
|
|||||||
'validate_cert' => true,
|
'validate_cert' => true,
|
||||||
'username' => $config_imap_username,
|
'username' => $config_imap_username,
|
||||||
'password' => $config_imap_password,
|
'password' => $config_imap_password,
|
||||||
'protocol' => 'imap'
|
'protocol' => 'imap',
|
||||||
|
'charset' => 'UTF-8' // Add charset to avoid encoding issues
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Connect to the IMAP server
|
// Connect to the IMAP server
|
||||||
@@ -350,6 +351,7 @@ try {
|
|||||||
$messages = $inbox->query()->unseen()->get();
|
$messages = $inbox->query()->unseen()->get();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo "Error: " . $e->getMessage();
|
echo "Error: " . $e->getMessage();
|
||||||
|
$messages = collect(); // Ensure $messages is defined as an empty collection
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($messages->count() > 0) {
|
if ($messages->count() > 0) {
|
||||||
@@ -432,10 +434,12 @@ if ($messages->count() > 0) {
|
|||||||
unlink("uploads/tmp/{$original_message_file}");
|
unlink("uploads/tmp/{$original_message_file}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
echo "No unseen messages found.";
|
||||||
}
|
}
|
||||||
|
|
||||||
$client->expunge();
|
$client->expunge();
|
||||||
$client->disconnect();
|
$client->disconnect();
|
||||||
|
|
||||||
// Remove the lock file
|
// Remove the lock file
|
||||||
unlink($lock_file_path);
|
unlink($lock_file_path);
|
||||||
Reference in New Issue
Block a user