Skip to content

Commit b73bb19

Browse files
committed
minor #12128 Add docs on Address::fromString (gisostallenberg)
This PR was squashed before being merged into the 4.4 branch (closes #12128). Discussion ---------- Add docs on Address::fromString See symfony/symfony#33086 Commits ------- 36960eb Add docs on Address::fromString
2 parents 20745f1 + 36960eb commit b73bb19

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
@@ -157,6 +157,15 @@ Multiple addresses are defined with the ``addXXX()`` methods::
157157
// ...
158158
;
159159

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

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

0 commit comments

Comments
 (0)