Skip to content

Commit 13ddb39

Browse files
Add docs on NamedAddress::fromString
See symfony/symfony#33086
1 parent 80ba67a commit 13ddb39

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

mailer.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,15 @@ Multiple addresses are defined with the ``addXXX()`` methods::
158158
// ...
159159
;
160160

161+
A NamedAddress can be created from a string
162+
163+
$email = (new Email())
164+
// ...
165+
->from(NamedAddress::fromString('Fabien <fabien@example.com>'))
166+
//
167+
;
168+
169+
161170
Alternatively, you can pass multiple addresses to each method::
162171

163172
$toAddresses = ['foo@example.com', new Address('bar@example.com')];

0 commit comments

Comments
 (0)