Closed
Description
Hello, I'm getting this exception
I added a try in the parse header function in the message class to pass the error.
private function parseHeader() {
$header = imap_fetchheader($this->client->connection, $this->uid, $this->fetch_options);
if ($header) {
$header = imap_rfc822_parse_headers($header);
}
if (property_exists($header, 'subject')) {
$this->subject = imap_utf8($header->subject);
}
if (property_exists($header, 'date')) {
try{
$this->date = Carbon::parse($header->date);
}catch (\Exception $e){
}
}
if (property_exists($header, 'from')) {
$this->from = $this->parseAddresses($header->from);
}
if (property_exists($header, 'to')) {
$this->to = $this->parseAddresses($header->to);
}
if (property_exists($header, 'cc')) {
$this->cc = $this->parseAddresses($header->cc);
}
if (property_exists($header, 'bcc')) {
$this->bcc = $this->parseAddresses($header->bcc);
}
if (property_exists($header, 'reply_to')) {
$this->reply_to = $this->parseAddresses($header->reply_to);
}
if (property_exists($header, 'sender')) {
$this->sender = $this->parseAddresses($header->sender);
}
if (property_exists($header, 'message_id')) {
$this->message_id = str_replace(['<', '>'], '', $header->message_id);
}
if (property_exists($header, 'Msgno')) {
$this->message_no = ($this->fetch_options == FT_UID) ? trim($header->Msgno) : imap_msgno($this->client->getConnection(), trim($header->Msgno));
}
}