krayin/laravel-crm · error · \Exception

Invalid type specified for getMessageBody(). "type" can eith

Error message

Invalid type specified for getMessageBody(). "type" can either be text or html.

What it means

Error "Invalid type specified for getMessageBody(). "type" can either be text or html." thrown in krayin/laravel-crm.

Source

Thrown at packages/Webkul/Email/src/Helpers/Parser.php:462

                    } else {
                        $htmlBody .= $this->decodeContentTransfer($this->getPartBody($part), $encodingType);
                        $htmlBody = $this->charset->decodeCharset($htmlBody, $this->getPartCharset($part));
                    }
                }
            }

            $body = $htmlBody ?: $textBody;

            if (is_array($this->files)) {
                foreach ($this->files as $file) {
                    if ($file['contentId']) {
                        $body = str_replace('cid:'.preg_replace('/[<>]/', '', $file['contentId']), $file['path'], $body);
                        $path = $file['path'];
                    }
                }
            }
        } else {
            throw new \Exception('Invalid type specified for getMessageBody(). "type" can either be text or html.');
        }

        return $body;
    }

    /**
     * Get text message body.
     *
     * @return string
     */
    public function getTextMessageBody()
    {
        $textBody = null;

        foreach ($this->parts as $key => $part) {
            if ($this->getPart('content-disposition', $part) != 'attachment') {
                $headers = $this->getPart('headers', $part);
                $encodingType = array_key_exists('content-transfer-encoding', $headers) ? $headers['content-transfer-encoding'] : '';

View on GitHub (pinned to 13d6988cda)

When it happens

Trigger: Thrown at packages/Webkul/Email/src/Helpers/Parser.php:462 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of krayin/laravel-crm@13d6988cda (2026-08-17). Data as JSON: /api/errors/c161d9efa78e8bd6. Report an issue: GitHub.