Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

SES+api Transport should also stringify from address #45660

Copy link
Copy link
Closed
@everyx

Description

@everyx
Issue body actions

Symfony version(s) affected

6.1

Description

When I set from address something like "中文" <admin@example.com>, the from name 中文 does not display correctly.

The reason is

There are non-ASCII characters in the email address—The email address string must be 7-bit ASCII. If you want to send to or from email addresses that contain Unicode characters in the domain part of an address, you must encode the domain using Punycode. Punycode is not permitted in the local part of the email address (the part before the @ sign) nor in the "friendly from" name. If you want to use Unicode characters in the "friendly from" name, you must encode the "friendly from" name using MIME encoded-word syntax, as described in Sending raw email using the Amazon SES API. For more information about Punycode, see RFC 3492.

- from Amazon SES email sending errors

We have already stringify to addresses, and we should also stringify the from address.

        $request = [
            'FromEmailAddress' => $envelope->getSender()->toString(),
            'Destination' => [
                'ToAddresses' => $this->stringifyAddresses($this->getRecipients($email, $envelope)),
            ],

- from https://github.com/symfony/amazon-mailer/blob/8ffe8053a854ca376b126eecd0e3a55f5b4ae8bf/Transport/SesApiAsyncAwsTransport.php#L55-L59

How to reproduce

send a email with from address name contain any non-ASCII chars, and the email will show a broken from name.

Possible Solution

stringify the from address

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.