Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
edwinricaurte opened this issue May 3, 2018 · 3 comments

Comments

@edwinricaurte
Copy link

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));**
}
@xUJYx
Copy link

xUJYx commented May 16, 2019

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
Copy link

xUJYx commented May 16, 2019

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

@jankapusta
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants