laravel-db-blade-compiler icon indicating copy to clipboard operation
laravel-db-blade-compiler copied to clipboard

quoted_printable_encode() expects parameter 1 to be string, array given

Open edwinricaurte opened this issue 7 years ago • 3 comments

After upgrade to Laravel 5.6, the system stopped working.

quoted_printable_encode() expects parameter 1 to be string, array given

/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php

public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0)
{
    if ($this->charset !== 'utf-8') {
        throw new RuntimeException(
            sprintf('Charset "%s" not supported. NativeQpContentEncoder only supports "utf-8"', $this->charset));
    }

    **return $this->standardize(quoted_printable_encode($string));**
}

edwinricaurte avatar May 03 '18 17:05 edwinricaurte

I have same problem on laravel 5.8 when using swiftmailer. swiftmail_error Content of the string when error triggered is empty array error_array_output If I transform empty array to empty string e-mail sending starts to work transfer_empty_array_to empty_string Mail starts to send with correct "address", "from", "subject", but without e-mail body...

Interesting things...

xUJYx avatar May 16 '19 08:05 xUJYx

I found it!!!

In new versions of laravel 5.6+ they moved call of call_user_func in /vendor/laravel/framework/src/Illuminate/Mail/Mailer.php in send($view, array $data = [], $callback = null) method... swiftmailer_error_point If you move it back as in previous laravel versions - problem will be solved!!! swiftmail_error_solved

xUJYx avatar May 16 '19 08:05 xUJYx

Thanks! I had same problem and this fixes it. I am using Laravel 8.1 and the error is still there, ... so I hope there is also some other solution (without overriding vendor code)

jankapusta avatar Sep 27 '20 19:09 jankapusta