Skip to content

[Mailer] JsonException is thrown when calling send() method #32043

@tristanbes

Description

@tristanbes

Symfony version(s) affected: 4.3.1

Description
I'm using the new Symfony Mailer, on a real app production environment some of this issue has happened:

Symfony\Component\HttpClient\Exception\JsonException

Response content-type is "text/html; charset=utf-8" while a JSON-compatible one was expected.

This error has been thrown by $this->mailer->send($email)

I'm also using symfony/mailgun-mailer

How to reproduce
I don't know, sorry :(

Possible Solution
Wrap the $this->mailer->send($email); in a try/catch block, but not sure how this error happens, and how to prevent it, or deal with it.

Additional context
mailer_JsonException

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