# Erreur 500 Collector - emailcollector.class.php

**URL:** <https://www.dolibarr.org/forum/t/erreur-500-collector-emailcollector-class-php/24889>\
**Category:** Other native modules\
**Tags:** Bug, PHP-Issues, v18\
**Created:** [January 26, 2024, 4:53pm UTC](https://www.dolibarr.org/forum/t/erreur-500-collector-emailcollector-class-php/24889 "2024-01-26T16:53:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tjeanneau](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/t/47e85d/32.png) [@tjeanneau](https://www.dolibarr.org/forum/u/tjeanneau)\
**Post date:** [January 26, 2024, 4:53pm UTC](https://www.dolibarr.org/forum/t/erreur-500-collector-emailcollector-class-php/24889/1 "2024-01-26T16:53:01Z")

</div>

Hello

Environment:  
PHP 7.4.33  
Apache/2.4.52 (Ubuntu)  
MySQL or MariaDB 5.5.5-10.6.12-MariaDB-0ubuntu0.22.04.1  
Current version of Dolibarr (Programs) 18.0.4

I am setting up dolibarr, and I want to configure the collector.  
The collector is with M365 & Oauth2.

When the mailbox is empty, the collector connects and tells me that no mail is available.  
When an email is present, I get an error 500.

The apache logs :  
[Fri Jan 26 16:46:56.730294 2024] [php7:error] [pid 1556] [client 192.168.99.11:56251] PHP Fatal error: Uncaught Error: Object of class Webklex\PHPIMAP\Message could not be converted to string in /usr/share/dolibarr/htdocs/emailcollec  
tor/class/emailcollector.class.php:1633\nStack trace:\n#0 /usr/share/dolibarr/htdocs/admin/emailcollector\_card.php(239): EmailCollector-\>doCollectOneCollector()\n#1 {main}\n thrown in /usr/share/dolibarr/htdocs/emailcollector/class/emai  
lcollector.class.php on line 1633, referer: https://_._._._/admin/emailcollector\_card.php?id=1&action=collecttest&token=3562aadc7b858a5f5483c47877e387c6&page\_y=448

Do you have an idea for a correction?

---

<div class="post-metadata">

**Author:** ![ksar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ksar/32/514_2.png) [@ksar](https://www.dolibarr.org/forum/u/ksar)\
**Post date:** [January 26, 2024, 4:53pm UTC](https://www.dolibarr.org/forum/t/erreur-500-collector-emailcollector-class-php/24889/2 "2024-01-26T16:53:55Z")

</div>

It’s a deepl translation of that : [Erreur 500 Collector - emailcollector.class.php - Autres modules natifs - Forum Dolibarr france](https://www.dolibarr.fr/forum/t/erreur-500-collector-emailcollector-class-php/45435)

---

<div class="post-metadata">

**Author:** ![Plows](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/plows/32/5660_2.png) [@Plows](https://www.dolibarr.org/forum/u/Plows)\
**Post date:** [January 27, 2024, 7:23pm UTC](https://www.dolibarr.org/forum/t/erreur-500-collector-emailcollector-class-php/24889/3 "2024-01-27T19:23:12Z")

</div>

Hi Tjeanneau,  
i have exact the same problem, i was experimenting with a new installation inkl. 19 Beta with PHP 8.1, the problem must be somwhere in PHP 7 or 8, the problems continue when collecting, it wont move the mail into archiv.  
I will be patient and wait for the final Version 19.
