I want to use SwiftMailer in Symfony2.
To start with, I created a new controller and copied the sample from <http://symfony.com/doc/current/cookbook/email/email.html>.
When I try to execute `renderView` I get the following error-message: `Fatal error: Call to a member function get() on a non-object in var/www/project/Symfony/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php on line 84`.

I tried various things, but they always will end up in an error in the controller.

Not only `renderView` but also `$this->get('mailer')->send($message);` is throwing an error.