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 1515use Symfony \Component \Mailer \MailerInterface ;
1616use Symfony \Component \Mime \Address ;
1717use Symfony \Component \Mime \Email ;
18+ use Symfony \Component \Mime \Part \DataPart ;
1819
1920class EmailController
2021{
@@ -25,15 +26,15 @@ public function indexAction(MailerInterface $mailer)
2526 ->addCc ('cc@symfony.com ' )
2627 ->text ('Bar! ' )
2728 ->html ('<p>Foo</p> ' )
28- ->attach ( file_get_contents (__FILE__ ), 'foobar.php ' )
29+ ->addPart ( new DataPart ( file_get_contents (__FILE__ ), 'foobar.php ' ) )
2930 );
3031
3132 $ mailer ->send ((new Email ())->to ('fabien@symfony.com ' , 'thomas@symfony.com ' )->from ('fabien@symfony.com ' )->subject ('Foo ' )
3233 ->addReplyTo (new Address ('me@symfony.com ' , 'Fabien Potencier ' ))
3334 ->addCc ('cc@symfony.com ' )
3435 ->text ('Bar! ' )
3536 ->html ('<p>Foo</p> ' )
36- ->attach ( file_get_contents (__FILE__ ), 'foobar.php ' )
37+ ->addPart ( new DataPart ( file_get_contents (__FILE__ ), 'foobar.php ' ) )
3738 );
3839
3940 return new Response ();
You can’t perform that action at this time.
0 commit comments