Skip to content

Commit 3bc96a4

Browse files
committed
Minor reword
1 parent b73bb19 commit 3bc96a4

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

mailer.rst

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,21 @@ both strings or address objects::
140140
// email address as an object
141141
->from(new Address('fabien@example.com'))
142142

143-
// email address as an object (email clients will display the name
144-
// instead of the email address)
143+
// defining the email address and name as an object
144+
// (email clients will display the name)
145145
->from(new Address('fabien@example.com', 'Fabien'))
146146

147+
// defining the email address and name as a string
148+
// (the format must match: 'Name <email@example.com>')
149+
->from(Address::fromString('Fabien Potencier <fabien@example.com>'))
150+
147151
// ...
148152
;
149153

154+
.. versionadded:: 4.4
155+
156+
The ``Address::fromString()`` method was introduced in Symfony 4.4.
157+
150158
Multiple addresses are defined with the ``addXXX()`` methods::
151159

152160
$email = (new Email())
@@ -157,15 +165,6 @@ Multiple addresses are defined with the ``addXXX()`` methods::
157165
// ...
158166
;
159167

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-
169168
Alternatively, you can pass multiple addresses to each method::
170169

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

0 commit comments

Comments
 (0)