During the assigning of the message body to the class property it could happen that you assign NULL or ERROR!
E.G:
$this->message->$typeMessage->body
// translates into
$this->message->plain->body
If $this->message->$typeMessage->body is empty or no base64 value, than the class property would be assigned with NULL or ERROR.
Problem is, that a mail can consist of more than one $this->message->plain->body. Unusual, but it happens.
So the latter Plain-Message overwrites all the Message-Bodys from before. And if the latter one is empty or no base64-string, the class value would be empty!
The solution is to check if imap_base64( $this->message->$typeMessage->body ) is empty or false.
Bug
See here: https://github.com/SSilence/php-imap-client/blob/master/ImapClient/IncomingMessage.php#L701
During the assigning of the message body to the class property it could happen that you assign NULL or ERROR! E.G:
If $this->message->$typeMessage->body is empty or no base64 value, than the class property would be assigned with NULL or ERROR.
Problem is, that a mail can consist of more than one $this->message->plain->body. Unusual, but it happens. So the latter Plain-Message overwrites all the Message-Bodys from before. And if the latter one is empty or no base64-string, the class value would be empty!
The solution is to check if imap_base64( $this->message->$typeMessage->body ) is empty or false.