Skip to content

[Mailer] Expected response code "250" but got code "550", with message "550 MIME message is missing 'From' header since 5.4.15 #48643

Closed
@VincentLanglet

Description

@VincentLanglet

Symfony version(s) affected

5.4.15

Description

When bumping Symfony mailer from 5.4.13 to 5.4.15 (and 5.4.16 doesn't solve the issue), I get the error

Expected response code "250" but got code "550", with message "550 MIME message is missing 'From' header".

when trying to send a mail with Sengrid integration.

I can confirm it's related to symfony/mailer since I fixed absolutely every other dependencies when swapping between 5.4.13 and 5.4.15.

How to reproduce

We have code like this

       $message = (new Email())
            ->to($recipient)
            ->from(new Address($senderEmail, $senderName))
            ->subject($subject);

        $envelope = new Envelope(new Address($senderEmail), [new Address($recipient)]);

        $body = $this->templatingService->render($mailTemplate, $data);
        $message->html($body);

        $this->mailer->send($message, $envelope);

which was working fine with older version.

The mailer was defined this way

$apiKey = $parameterBag->get('mailer_password');
$transport = new SendgridSmtpTransport($apiKey, $eventDispatcher);
$this->mailer = new Mailer($transport);

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions