Skip to content
This repository was archived by the owner on Jul 16, 2021. It is now read-only.
This repository was archived by the owner on Jul 16, 2021. It is now read-only.

After update from laravel 5.5 to laravel 5.8 swiftmailers setBody method doesnt make any changes to body #1646

Open
@xUJYx

Description

@xUJYx

Made a copy of this one issue.
PR #22995 to fix #22982 cause this problem...

Any ideas about ways to resolve such problem and save standart swiftmailers methods work?
Maybe it can be made with some flags which will say to laravel core when to make call_user_func before or after addContent call ?
==========================================================================

  • Laravel Version: 5.8.17
  • PHP Version: 7.3.5

Description:

After update laravel version from 5.5 to 5.8 when using swiftmailer raw method, mail sending starts to give error quoted_printable_encode() expects parameter 1 to be string, array given
swiftmail_error
If you provide some raw string data as first parameter - mail will be sent, BUT callback function will not make any changes to body with setBody method...
error_doesnt_overwrite

Steps To Reproduce:

Try to send e-mail with raw method using swiftmailer:
error_reproduce
`Mail::raw([], function ($message)

{
$message->to('some@email.test');
$message->from('from@my.mail', 'MyName');
$message->subject('Test email send');
$message->setBody('Some cute html body to send', 'text/html');
});`

How To Solve Problem:

In new versions of laravel 5.6+ had been 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 call_user_func back as in previous laravel versions - problem will be solved and all will start work well.
swiftmail_error_solved

Thats it...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions