File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -135,13 +135,21 @@ both strings or address objects::
135135 // email address as an object
136136 ->from(new Address('fabien@example.com'))
137137
138- // email address as an object (email clients will display the name
139- // instead of the email address )
138+ // defining the email address and name as an object
139+ // (email clients will display the name )
140140 ->from(new Address('fabien@example.com', 'Fabien'))
141141
142+ // defining the email address and name as a string
143+ // (the format must match: 'Name <email@example.com>')
144+ ->from(Address::fromString('Fabien Potencier <fabien@example.com>'))
145+
142146 // ...
143147 ;
144148
149+ .. versionadded :: 4.4
150+
151+ The ``Address::fromString() `` method was introduced in Symfony 4.4.
152+
145153Multiple addresses are defined with the ``addXXX() `` methods::
146154
147155 $email = (new Email())
You can’t perform that action at this time.
0 commit comments