If I just add the header in the mailable:
public function headers()
{
return new Headers(
text: [
'Return-Path' => config('mail.from.address'),
],
);
}
I get an error:
The "Return-Path" header must be an instance of "Symfony\Component\Mime\Header\PathHeader" (got "Symfony\Component\Mime\Header\UnstructuredHeader").
Only solution I found was with "using" in Envelope:
That works for me.
I also tried to add a name:
But that creates an invalid result:
I guess name is not supported here?