-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Fixes email adresses format in header #31986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Can you create a small script that shows the error? In |
Hello @fabpot , Here is my current code: <?php
$email = (new TemplatedEmail())
->from(new NamedAddress('sender@test.com', 'Sender'))
->to(new NamedAddress('recipient@test.com', 'Recipient'))
->subject($subject)
->text('Some content');
$this->mailer->send($email); The current implementation will result in (
The following exception is thrown: Working behavior is/should be:
Note that this issue has been identified using Amazon SES SMTP transport which internally uses the Last, note that the |
Are you using the component without any modification? I fail to see how that's possible. I've even created a small script to test it and I'm not able to reproduce your behavior. |
No changes at all (just rm/reinstalled vendors to be sure). BTW, the only requirement I have in my composer file is Composer info: |
Got it now! Working on a fix. |
This PR was merged into the 4.3 branch. Discussion ---------- Fix sender/recipients in SMTP Envelope | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #31986 | License | MIT | Doc PR | n/a <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/roadmap): - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against branch 4.4. - Legacy code removals go to the master branch. --> Commits ------- 7a2f9bf fixed sender/recipients in SMTP Envelope
In the mailer component, when using
Symfony\Component\Mime\NamedAddress
instances forFROM
/TO
with SMTP transport, the headers will be misconfigured ieMAIL FROM:Sender Name<test@test.com>
when the header must beMAIL FROM:<test@test.com>
.The corresponding names will be used properly in the
DATA
section (see https://github.com/symfony/symfony/blob/4.3/src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php#L157)