File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Tests/Functional/Bundle/TestBundle/Controller Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 15
15
use Symfony \Component \Mailer \MailerInterface ;
16
16
use Symfony \Component \Mime \Address ;
17
17
use Symfony \Component \Mime \Email ;
18
+ use Symfony \Component \Mime \Part \DataPart ;
18
19
19
20
class EmailController
20
21
{
@@ -25,15 +26,15 @@ public function indexAction(MailerInterface $mailer)
25
26
->addCc ('cc@symfony.com ' )
26
27
->text ('Bar! ' )
27
28
->html ('<p>Foo</p> ' )
28
- ->attach ( file_get_contents (__FILE__ ), 'foobar.php ' )
29
+ ->addPart ( new DataPart ( file_get_contents (__FILE__ ), 'foobar.php ' ) )
29
30
);
30
31
31
32
$ mailer ->send ((new Email ())->to ('fabien@symfony.com ' , 'thomas@symfony.com ' )->from ('fabien@symfony.com ' )->subject ('Foo ' )
32
33
->addReplyTo (new Address ('me@symfony.com ' , 'Fabien Potencier ' ))
33
34
->addCc ('cc@symfony.com ' )
34
35
->text ('Bar! ' )
35
36
->html ('<p>Foo</p> ' )
36
- ->attach ( file_get_contents (__FILE__ ), 'foobar.php ' )
37
+ ->addPart ( new DataPart ( file_get_contents (__FILE__ ), 'foobar.php ' ) )
37
38
);
38
39
39
40
return new Response ();
You can’t perform that action at this time.
0 commit comments