Open Pok4 opened 4 weeks ago
i fixed it :) Here:
use Webklex\PHPIMAP\ClientManager;
//sent email to send folder
if (!empty(get_from_db_config('imap_server')) &&
!empty(get_from_db_config('imap_email')) &&
!empty(get_from_db_config('imap_pass'))) {
$cm = new ClientManager();
$client = $cm->make([
'username' => get_from_db_config('imap_email'),
'password' => ''.get_from_db_config('imap_pass').'',
'host' => get_from_db_config('imap_server'),
'port' => 993,
'encryption' => 'ssl',
'protocol' => 'imap',
'validate_cert' => false,
]);
$client->connect();
$inbox = $client->getFolder(get_from_db_config('imap_folder') ?? 'Sent');
$inbox->appendMessage($rawMessage);
$client->disconnect();
}
Hello there, and sorry for my english.
I have this one:
i get the following error:
Fatal error: Uncaught TypeError: Webklex\PHPIMAP\Client::setAccountConfig(): Argument #2 ($default_config) must be of type array, null given, called in C:\xampp2\htdocs\vendor\webklex\php-imap\src\Client.php on line 238 and defined in C:\xampp2\htdocs\vendor\webklex\php-imap\src\Client.php:258 Stack trace: #0 C:\xampp2\htdocs\vendor\webklex\php-imap\src\Client.php(238): Webklex\PHPIMAP\Client->setAccountConfig('host', NULL) #1 C:\xampp2\htdocs\vendor\webklex\php-imap\src\Client.php(189): Webklex\PHPIMAP\Client->setConfig(Object(Webklex\PHPIMAP\Config)) #2 C:\xampp2\htdocs\App\Models\Admin\View_Emails_Model.php(119): Webklex\PHPIMAP\Client->__construct(Object(Webklex\PHPIMAP\Config)) #3
i try many things with ChatGPT, including everything to be in Client([]), but same error... Im using last dev-master version. I dont know where i make a mistake..