Conditionally set logger and queue on mailer

Possible since https://github.com/laravel/framework/pull/4648
array cast is too early
Merge pull request #5523 from lucasmichot/4.2-validation-getrules

[4.2] Validation : array cast happens too early
Merge pull request #5513 from alprs/fix/mailer-conditional-set

Conditionally set logger and queue on mailer
Extract method.
Merge branch '4.2'