How can i use Swift mailer in my php code in symfony
===

I am using this but i am getting error

    foo_bundle.listener.comment:
            class: xxx\Listener\CupleListener
            arguments: [@mailer]

-------

    class CupleListener
    {
    	protected $mailer;
    
    	public function __construct(Swift_Mailer $mailer)
    	{
    		$this->mailer = $mailer;
    	}
    
    	public function onCenterEvent(CupleEvent $event)
    	{
    		$center = $event->getcenter();
    		
    			$message = \Swift_Message::newInstance()
    			->setSubject('New comment posted on ' . $post->getTitle())
    			->setFrom('send@example.com')
    			->setTo('xxxxxxxxxx')
    			->setBody("Hey, somebody left a new comment on a post you're subscribed to! It says: " . $comment->getBody());
    			$this->mailer->send($message);
    		
    	}
    }

This is giving error

Also i don't know which class to include on the top of namespace