Skip to content

Commit 4e207ba

Browse files
authored
fix(MailToFileSender): allow _ in email names (#155)
1 parent ae1f691 commit 4e207ba

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Sender/MailToFileSender.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function send(iterable $frames): void
5252
private static function normalizeEmail(?string $email): ?string
5353
{
5454
$normalized = \preg_replace(
55-
['/[^a-z0-9.\\- @]/i', '/\s+/'],
55+
['/[^a-z0-9.\\-_ @]/i', '/\s+/'],
5656
['!', '_'],
5757
(string) $email,
5858
);

tests/Unit/Sender/MailToFileSenderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testForSmtp(): void
3636
'User1 <[email protected]>',
3737
3838
'User without email', // no email
39-
'User3 <[email protected]>, User4 <[email protected]>, user5@inline.com',
39+
'User3 <[email protected]>, User4 <[email protected]>, us_er_5@inline.com',
4040
],
4141
'Subject' => ['Very important theme'],
4242
'Content-Type' => ['text/plain'],
@@ -50,7 +50,7 @@ public function testForSmtp(): void
5050
$this->assertRecipient("$root/[email protected]");
5151
$this->assertRecipient("$root/[email protected]");
5252
$this->assertRecipient("$root/[email protected]");
53-
$this->assertRecipient("$root/user5@inline.com");
53+
$this->assertRecipient("$root/us_er_5@inline.com");
5454
}
5555

5656
protected function tearDown(): void

0 commit comments

Comments
 (0)